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

L

laredotornado

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
 
R

Richard Cornford

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.
 

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

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top