Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #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?



  #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)
  #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.

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

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