Problems with javascript in firefox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kiran

    Problems with javascript in firefox

    hi,
    iam facing a problem in javascript. iam using a slider in program. i
    requires a js file which i have included. iam passing a parameter
    through this statement s.function(v). the function is in js file and
    this keyword is used for eg. this._range=v this gives error in firefox.
    can anyone let me know is this keyword causing problem or something
    else

  • VK

    #2
    Re: Problems with javascript in firefox


    kiran wrote:
    iam passing a parameter through this statement s.function(v).
    That would be an illegal statement as <functionis a JavaScript
    keyword.
    If you are doing something like:
    var s = {'function':fun ction(){window. alert('OK');}}
    s.function();
    then such syntax is not acceptable. If you indeed absolutely absolutely
    have to have a method named "function" then you have to use squared
    brackets notation:
    var s = {'function':fun ction(){window. alert('OK');}}
    s['function']();
    this keyword is used for eg. this._range=v this gives error in firefox.
    can anyone let me know is this keyword causing problem or something
    So what statement are having problem with? s.function() or
    this._range=v ?

    Comment

    • kiran

      #3
      Re: Problems with javascript in firefox


      kiran wrote:
      hi,
      iam facing a problem in javascript. iam using a slider in program. i
      requires a js file which i have included. iam passing a parameter
      through this statement s.function(v). the function is in js file and
      this keyword is used for eg. this._range=v this gives error in firefox.
      can anyone let me know is this keyword causing problem or something
      else
      ok
      as i have already told that iam using slider in my webpage
      s is a slider object
      iam calling s.getMaximum() function from my webpage. the get
      maximumfuntion is defined in another js file. there in getMaximum
      function
      return this._range.get Maximum() is used

      i get an error
      Error: this._range has no properties

      Comment

      • The Magpie

        #4
        Re: Problems with javascript in firefox

        kiran wrote:
        kiran wrote:
        >hi,
        >iam facing a problem in javascript. iam using a slider in program. i
        >requires a js file which i have included. iam passing a parameter
        >through this statement s.function(v). the function is in js file and
        >this keyword is used for eg. this._range=v this gives error in firefox.
        >can anyone let me know is this keyword causing problem or something
        >else
        ok
        as i have already told that iam using slider in my webpage
        s is a slider object
        iam calling s.getMaximum() function from my webpage. the get
        maximumfuntion is defined in another js file. there in getMaximum
        function
        return this._range.get Maximum() is used
        >
        i get an error
        Error: this._range has no properties
        >
        It may help if we can see the script. Perhaps you could give us a link
        to it or post it?

        Comment

        • ASM

          #5
          Re: Problems with javascript in firefox

          kiran a écrit :
          iam passing a parameter
          through this statement s.function(v).
          ....
          gives error in firefox.
          Generally the typical error when occurs in Fx and not in IE
          is that the element hasn't an id

          <img name="foo" ...>
          could works with IE and not with Fx
          if function addresses to an id

          Firefox needs :

          <img id="foo" ... >

          Yo avoid this kind of error, always tape :

          <img name="foo" id="foo" ... >


          --
          Stephane Moriaux et son [moins] vieux Mac

          Comment

          Working...