Coastal Web
12-27-2005, 04:38 PM
Hello everyone I've got a quick question that l was hoping one of your Javascript Vets would be able to help me with...
My site uses the following javascript to "break" out of frames when a site links to mine using a framed page (which happens quite often):
<!--snip of code...
if (window != top) {
top.location.href = location.href;
}
//end of snip--->
However the situation has come up that l *want* to allow one specific domain to be able to link to my site, and keep the frames intact.
By using something like this:
<!--snip of code...
if ((window != top) && && (topURL.indexOf("www.someDomain.com") > 0)) {
top.location.href = location.href;
}
//end of snip--->
The question;
How would l set the variable of topURL to be that of the site that's linking to me with the frame?
Any help would be greatly appreciated.
Samantha gram
My site uses the following javascript to "break" out of frames when a site links to mine using a framed page (which happens quite often):
<!--snip of code...
if (window != top) {
top.location.href = location.href;
}
//end of snip--->
However the situation has come up that l *want* to allow one specific domain to be able to link to my site, and keep the frames intact.
By using something like this:
<!--snip of code...
if ((window != top) && && (topURL.indexOf("www.someDomain.com") > 0)) {
top.location.href = location.href;
}
//end of snip--->
The question;
How would l set the variable of topURL to be that of the site that's linking to me with the frame?
Any help would be greatly appreciated.
Samantha gram