Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Sep 2011
    Posts
    19
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Only doesn't work in Firefox

    Heya,

    I wrote the following page in a day or two (please don't mind the layout). Everything seems to work excellent, apart from in Firefox (FF) in which it doesn't seem to work at all. None of the other browsers have any trouble with it.

    I'm pretty new to Javascript (everything you see in the source code is pretty much all I know) and I have absolutely no idea why it doesn't work in Firefox.

    The page in question could be found [link has been removed]. It's all there is to it.

    So yeah, how to actually make this work in FF? Thanks a whole bunch in advance! Much appreciated.
    Last edited by snakehill; 09-06-2011 at 03:44 PM.

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,398
    Thanks
    12
    Thanked 570 Times in 563 Posts
    You should start to do some basic debugging using browser tools like Firebug for Firefox. It will immediately tell you "paypal is not defined". You are using a variable paypal in the onclick of the button. And this variable is undefined.

    Are you trying to use paypal as an "implicit" name or did you actually define paypal somewhere in Javascript?

  • Users who have thanked devnull69 for this post:

    snakehill (09-06-2011)

  • #3
    New Coder
    Join Date
    Sep 2011
    Posts
    19
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Thank you! I figured that I did put id="paypal", but Firefox apparently is the only browser that looked specifically for name="paypal" instead.

  • #4
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,398
    Thanks
    12
    Thanked 570 Times in 563 Posts
    You should never assume that name/id attributes are exposed to Javascript just like that. You should always use document.getElementById() or document.getElementsByName() instead.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •