|
-
Apr 13th, 2004, 08:57 AM
#1
Thread Starter
Frenzied Member
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.
-
Apr 13th, 2004, 09:27 AM
#2
Thread Starter
Frenzied Member
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.
-
Apr 13th, 2004, 11:09 AM
#3
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.
-
Apr 13th, 2004, 02:54 PM
#4
Thread Starter
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|