Forum Moderators: open
I have read [netmechanic.com ]
and also [webmasterworld.com ].
I have correctly added the appropriate script into all orphaned pages and created my master.html file, but neither seems to work in practise, the most common error being an empty frame "<html></html>" which I guess would mean that it's not picking up the contentURL.
My (test) page ("master.html") has this within it:
<SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
origURL = parent.document.URL
contentURL = origURL.substring(origURL.indexOf('?')+1, origURL.length)
document.write('<iframe src="' + contentURL + '" width="200" height="150" title="your title"></iframe>')
</script>
I have also tryied it in a traditional frameset with the following code within the "master.html":
<SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
origURL = parent.document.URL contentURL = origURL.substring(origURL.indexOf('?')+1, origURL.length)
document.write('<frameset rows="158,*" cols="*" frameborder="NO" border="0" framespacing="0">
<frame src="top_s.htm" name="topFrame" scrolling="NO" noresize >
<frameset cols="95,*" frameborder="NO" border="0" framespacing="0">
<frame src="left_s.htm" name="leftFrame" scrolling="NO" noresize>
<frame src="' + contentURL + '" name="main">
</frameset></frameset>')
</script>
Which loads the correct frameset nicely, but again where the correct contentURL page should be I just get "<html></html>"
Any thoughts? (please! :o)
[edited by: tedster at 10:48 pm (utc) on Nov. 19, 2003]
Does your script on each potentially orphaned page look like this?
passpage = document.URL
if (top.location == self.location)
top.location.href="master.html?" + passpage
And if so, what does the url of the potentially orphaned page look like -- does it, by any chance, have it's own query string or something other oddity?
Would the script encounter problems when tested via Dreamweaver locally? I have uploaded to a test site and the script is working nicely within a "standard" frameset.
You can test this via accessing this orphan page: <no URLS, please>. However, the live site views via an iframe. I am trying to get my head around how to incorporate the parent content (which is not a frameset) and have the orphan load within it. Is it as simple as effectively making the index_n.htm the master.html?
[edited by: tedster at 3:13 pm (utc) on Nov. 20, 2003]
And you are on the right track with an iframe version. Your "master" page will just be a version of the page that holds the iframe, but with this script in place of the original iframe code. As with the conventional frameset solution, you will need one separate master page in addition to your index page.
<SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">origURL = parent.document.URL
contentURL = origURL.substring(origURL.indexOf('?')+1, origURL.length)
</script>
<SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">document.write('<iframe id=id1 name="main" src="'+ contentURL +'" width="640" scrolling="auto" frameborder="0" marginwidth="0" marginheight="0" height="442" ><a href="index_s.htm">Your Browser does not support iframes = PLEASE CLICK HERE TO VIEW THE SITE =-</a></iframe>')
</script>
It works anyhow - would be interesting to know if you would have done it the same way.
Thanks very much for your help! (what a wonderful forum!)