Connecting Tech Pros Worldwide Forums | Help | Site Map

Why can't I do string manipulation on location.href?

laredotornado@zipmail.com
Guest
 
Posts: n/a
#1: Jul 27 '06
Hi,

I keep getting the error, "Error: uncaught exception. Permission
denied to get property Location.href" when executing this function:

function checkUpperFrame() {
var l = top.frames['login'].location.href;
if (l.indexOf("teacher_hub") == -1) {
setTimeout(checkUpperFrame, 100);
} else {

top.location.replace("http://my-stage.hrw.com/support/file_portal/");
} // if
} // checkUpperFrame

Why am I getting this error and what can i do to correct it?

Thanks, - Dave


Richard Cornford
Guest
 
Posts: n/a
#2: Jul 27 '06

re: Why can't I do string manipulation on location.href?


laredotornado@zipmail.com wrote:
Quote:
I keep getting the error, "Error: uncaught exception. Permission
denied to get property Location.href" when executing this function:
>
function checkUpperFrame() {
var l = top.frames['login'].location.href;
<snip>

Presumably the page loaded into - top.frames['login'] -, or into - top
- is not from the same domain as the page on which the script is
executing.

Richard.

Closed Thread