PDA

View Full Version : location.href permission denied


jollywoz
10-22-2002, 12:58 PM
hi all,
i'm using a script to be able to load up framed pages in context but while the script works i get a permission denied error which i believe is when you try to get info on pages from other domains, problem is all the pages are under the same domain so i'm confused.

this is the code in each page

if (parent.location.href == self.location.href){
top.location.href = 'http://www.domain/framepage.htm?'+location.href;
}

and this is the code in the frames page

document.write('<frame name="mainframe" scrolling="AUTO" src="'+(location.search ? location.search.substring(1)):'defaulturl.htm')+'">');

thx in advance

beetle
10-22-2002, 03:27 PM
Are you actually testing them online? Cause testing them local would cause this too

Do you know which location.href reference is being denied? Try alerting a few values (parent.location.href, self.location.href) see if you can determine where the holdup is...

Note: I've done a script like this before, but it uses cookies (http://www.peterbailey.net/js/superframes.js)

Roy Sinclair
10-22-2002, 03:27 PM
Be sure you've got the exact same domain names, if one page loads without the "www" and the other loads with the "www" then you effectively have two different domains even if they were served by the same server from the same directory.