Forum Moderators: open

Message Too Old, No Replies

Why this doesn't work in Firefox/Mozilla?

parent.location.href

         

mirceagoia

7:16 am on Mar 23, 2006 (gmt 0)

10+ Year Member



I am using this like:
-------
<html><body><script>parent.location.href('page.asp?zip1=1')</script></body></html>
-------

or

-------
<a href='javascript:onClick=parent.location.href("uploadimages.asp?zip=1");'><B>Reload</B></a>
-------

Why it's not working in Firefoex and Mozilla? in IE works fine...

Any ideas how to have something like this to work in all these browsers?

Thanks.

tempsingle

7:46 am on Mar 23, 2006 (gmt 0)



try this: parent.location='page.asp?zip1=1'

Bernard Marx

8:56 am on Mar 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



or

parent.location.href = "uploadimages.asp?zip=1";

href isn't a method, but a property.

mirceagoia

9:39 am on Mar 23, 2006 (gmt 0)

10+ Year Member



Both are not working :(...

kaled

11:53 am on Mar 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try this...

<a href ="#" onclick="parent.location.href='uploadimages.asp?zip=1'; return false">Reload</a>

1) href is for urls. So-called javascript-urls (beginning javascript:) can mostly be avoided.
2) Use events such as onclick to attach your javascript and always return a result (even if the event doesn't need it).
3) Be certain that you actually need javascript. In this example, you don't. The following will work...

<a href ="uploadimages.asp?zip=1" target="_parent">Reload</a>

Trying to learn the basics of a technical subject (like web development) from the internet is a bad idea - books are the way to go (most books are rubbish but they're much better than nothing).

Kaled.

mirceagoia

3:01 pm on Mar 23, 2006 (gmt 0)

10+ Year Member



Thank you!

Usually, the internet is my library...the biggest library...but maybe not the best one, who knows...

kaled

4:27 pm on Mar 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Usually, the internet is my library...the biggest library...but maybe not the best one, who knows...

Doctors and lawyers use the internet, but would you trust one that relied on it as their only source of information?

Kaled.

mirceagoia

7:41 pm on Mar 25, 2006 (gmt 0)

10+ Year Member



And what you do when you need info fast? And don't own books?

So far the Internet served me well and I don't think that only doctors and lawyers use it...I was able to find useful and reliable info here.

The proof is this forum...many webmasters use this as source of information...not the only one, of course.