window.location.href with encode?

S

soni2926

Hi,
I have a pop up window, that window needs to refresh the parent window
when opened, I'm doing the following:

window.opener.location.href(window.opener.location.href);

problem I'm having is that the parent url has a # sign in it, like:
http://localhost/mysite/me.html#01

i need the #01 to stay in the url after the refresh, anyway to do
this? i tried using escape(window.opener.location.href) but that
didn't work, as it escaped everything including the :// in http://

i also tried
window.opener.location.href(window.opener.location.protocol + "//" +
window.opener.location.hostname + window.opener.location.pathname);

problem with that was i lost the #01 in the url, pathname didn't
include it...

any ideas?

Thanks.
 
S

scripts.contact

Gérard Talbot said:
First, you need to verify that the opener reference still exists: this
will make your javascript code robust, not triggering javascript errors:

if(opener)
{
opener.location.reload(true);
};

if(opener && !opener.closed)
opener.location.reload(true);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,161
Messages
2,570,892
Members
47,428
Latest member
RosalieQui

Latest Threads

Top