Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 23rd, 2007, 08:08 AM
Authorized User
Join Date: Nov 2005
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default IE7 and parent.location not working?


 In a script used by svg, I have a like like the following to go to a new web page:

 parent.location.href = newUrl;

 This works fine in IE6. However, it has no effect in ie7 (not even a error message, or security message) It just does nothing.

 I have noised when i do:
 alert(loc + "?" + entityName);
 parent.parent.location = loc + "?" + entityName;  alert(parent.parent.location.href);

 values displayed by alert are not the same!!! parent.parent.location was not overwritten.

 (I tried window.location=, window.assign(newUrl), parent.location.href, parent.location= .... none of it works, and I don't get an error message)

 Project uses Frames.

 Is this expected behavior in ie7? Is this a security thing? Where is there information on this?



Reply With Quote
  #2 (permalink)  
Old April 23rd, 2007, 11:44 PM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts

I believe the location property is read only if the page is in a different domain or uses a different scheme (https instead of http for example).


Joe (Microsoft MVP - XML)
Reply With Quote
  #3 (permalink)  
Old April 24th, 2007, 09:30 AM
Authorized User
Join Date: Nov 2005
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts


I was able to work around the problem by having a script in my page that was called from svg.

You can call a script function that resides on the page from a svg script.

I just put a function like

gotoUrl(u) { parent.location.href = u; }
on the main page and called this from SVG.

Thank you very much for your suggestion , it puts me on a right tracks.

But it is a workaround, I still do not understand the couse of the problem.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
IE7 script not working on linux server luminus BOOK: CSS Instant Results 9 February 1st, 2016 07:35 AM
parent.location.reload() not working in FireFox AbrarNazeer Javascript 3 February 25th, 2008 05:35 AM
parent.location.reload() issue in FireFox AbrarNazeer Javascript 1 February 21st, 2008 09:07 AM
Image preview not working in IE7.Please help subhasps8 ASP.NET 2.0 Professional 0 October 3rd, 2007 12:35 AM
location.replace not working, any ideas? swin Javascript 4 February 15th, 2006 06:57 AM

All times are GMT -4. The time now is 04:56 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.