Results 1 to 4 of 4

Thread: JS Link not working in Gecko?

  1. #1

    Thread Starter
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994

    JS Link not working in Gecko?

    I use this link to add a product to a cart(I've made a small shopping system), what it does is basically set the 'Cart' frame to an ASP page adding the product to a session variable. The works fine in Mosaic, but in Gecko it just doesn't do anything:

    Code:
    
    <a href=# onClick="parent.document.all.vogn.src='cartadd.asp?type=mobil&abb=0&model=Nokia 3200 - Headset&price=199';alert('The product has been added to the cart');">Add</a>
    Can anyone tell me what's wrong?
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

  2. #2

    Thread Starter
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994
    Oh, and one more thing, how do I/is it possible to call a function in a parent frame... I tried doing "parent.myfunction()", but that doesn't seem to work...

    Cheers!
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    You can't use document.all in Gecko.
    Make sure that the element you use has the id attribute set (not just name) and use document.getElementById("id") to get it. This works in IE 5.5+ too.

    Your URL is also invalid, strictly seen. All browsers I know accept it, but actually you need to replace all spaces with either + or %20.

    parent.myfunction() should work, in theory. I remember using something similar once. Try
    parent.window.myfunction()
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4

    Thread Starter
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994
    Originally posted by CornedBee
    You can't use document.all in Gecko.
    Make sure that the element you use has the id attribute set (not just name) and use document.getElementById("id") to get it. This works in IE 5.5+ too.

    Your URL is also invalid, strictly seen. All browsers I know accept it, but actually you need to replace all spaces with either + or %20.

    parent.myfunction() should work, in theory. I remember using something similar once. Try
    parent.window.myfunction()
    Thanks mate, I'll try that as soon as I get to work tommorow - I do have '%20' between my spaces though, it's because I needed to write this without the ASP inserts, so it kinda messed up on me =).

    Cheers!
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

Posting Permissions

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



Click Here to Expand Forum to Full Width