Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > window.opener.location.href does not work on Mac.

Reply
Thread Tools

window.opener.location.href does not work on Mac.

 
 
alison
Guest
Posts: n/a
 
      11-21-2005
I am trying to redirect the parent page when the user clicks an html
button in an aspx page by using the javascript:
window.opener.location.href="EditOrders.aspx"; This works fine on IE
for windows or Firefox, however on IE for Mac or Safari on Mac, it
doesn't work. If I enable script errors on IE for Mac, I get:
'window.opener.location' is not an object. Any ideas on how to get this
to work on Mac browsers? Thanks!

 
Reply With Quote
 
 
 
 
VK
Guest
Posts: n/a
 
      11-21-2005

alison wrote:
> I am trying to redirect the parent page when the user clicks an html
> button in an aspx page by using the javascript:
> window.opener.location.href="EditOrders.aspx"; This works fine on IE
> for windows or Firefox, however on IE for Mac or Safari on Mac, it
> doesn't work. If I enable script errors on IE for Mac, I get:
> 'window.opener.location' is not an object. Any ideas on how to get this
> to work on Mac browsers?


Try instead window.opener.document.location.href="EditOrders.a spx";
(this is not better and you variant is more correct, but just to sort
out all options).

 
Reply With Quote
 
 
 
 
alison band
Guest
Posts: n/a
 
      11-22-2005
Thanks, but that still doesn't work. If I enable IE on Mac to display
script errors, it displays: "'window.opener.document' is not an object".



*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      11-23-2005
alison wrote:

> I am trying to redirect the parent page when the user clicks an html
> button in an aspx page by using the javascript:


Hopefully you are not using the `javascript:' label here as that would
be either useless or error-prone.

> window.opener.location.href="EditOrders.aspx"; This works fine on IE
> for windows or Firefox, however on IE for Mac or Safari on Mac, it
> doesn't work. If I enable script errors on IE for Mac, I get:
> 'window.opener.location' is not an object. Any ideas on how to get this
> to work on Mac browsers? Thanks!


Try alert(window) and alert(window.opener) to see if both refer to an
object. If either does not, it would be prudent if you posted how you
opened the new window. If it does, try alert(window.opener.location).
If that returns the URL of the document displayed in the opening window,
try

if (window.opener && !window.opener.closed)
{
window.opener.location = "EditOrders.aspx";
}

instead.


HTH

PointedEars
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MS work around on text wrapping in a datagrid does not work TB ASP .Net 2 02-22-2006 10:34 PM
Why does post or pre incremenent or decrement does not work inside a sizeof operator? Tarun C Programming 5 07-14-2005 03:58 PM
Why does this (very simple piece of) code does not work? jblazi Python 5 08-16-2004 01:30 PM
Webservice works once and then DOES NOT seem to work even though program does not crash Phi! ASP .Net Web Services 1 04-23-2004 08:42 AM
int('2.1') does not work while int(float('2.1')) does Vineet Jain Python 9 04-16-2004 10:12 AM



Advertisments