Masked forwards are essentially loading your page inside a frameset on another server to make it appear that it's on that server. If you go to your domain and view source, you should see what I mean. In IE, you have to go to view at the top and then "view source" because right-click and view source will show the frame's source instead. Taking that into consideration:
top.SetPageTitle() doesn't exist, and furthermore, your script is now violating the same origin restriction. IE just gives a generic error, but Firefox and Opera will give you a permission denied error due to this.
parent.SetPageTitle() exists, but it is not going to change the title in the browser window because it's not in the top frameset anymore.
You have the same choice I had. Mask the forward and lose control of the page title, or control the page title and lose the mask. Personally, I got rid of the mask since it's easy enough for someone to tell that it's a forward anyway.
Quote:
Originally Posted by rrmunn
I have had a frames based website running for a quite a while in which every page has the following call:
<body onload="top.SetPageTitle()">
...
</body>
This is used to force the browser title to be set to the page title for a page loaded into a frame.
The index.html page is setup as follows:
<head>
<script language=JavaScript>
function SetPageTitle() {
document.title = Main.document.title;
}
</script>
</head>
<frameset cols="150,*">
<frame name="TOC" target="main" src="TOC.htm" scrolling="auto">
<frame name="Main" src="Home.htm" scrolling="auto" target="_self">
...
</frameset>
This is pretty straight forward and has worked fine (no comments about using frames please!!!!).
Very recently I signed up for my own domain name and setup web forwarding (frame forwarding) to cloak the target hosting site
So www.mydomain.com ==> www.isp.com/~me
The cloaking forces the browser to only show www.mydomain.com.
But now every page generates an error "Object doesn't support this property or method" for the call to SetPageTitle.
I'm really not sure why the forwarding causes this. If you bypass the domain and go to the target hosting site (i.e. www.isp.com/~me) the error does not occur. Similarly if I turn off frame forwarding and just use standard forwarding it id fone but the browser will show the real target URL. It also appears that firefox does not seem to have a problem whereas IE does but then again firefox does not seem to show a lot of scripting errors anyway.
I'm not totally sure what the frame forwarding does that could cause this, Can someone explain what is going on?