Force orphan url open within outside url iFrame
--------------------------------------------------------------------------------
I am trying to force database search results (html) adress to open as an IFrame with-in an outside URL. Have tried using script I saw here, but it doesnt quite fit. This requires two scripts; one for the TOP/Parent page and another for the orphaned page. essentially redirectiing the orphan page to always open with-in the IFrame of the parent page.
I know this can be done as evidenced from prior feeds on this forum....
http://www.dynamicdrive.com/forums/s...ead.php?t=2354, also follow up at http://www.dynamicdrive.com/forums/s...36&postcount=4 and the code i've used is from there:
Parent >>>>>>>>>>>>
<script type="text/javascript">
var text = window.location.href;
function delineate(str) {
theleft = str.indexOf("=") + 1;
theright = str.indexOf("&");
return(str.substring(theleft, str.length));
}
url=delineate(text)
function refreshFrame() {
if(window.location!=url)
frames['maincontentarea'].window.location.replace(url);
}
</script></head><body><iframe onload="calcHeight();" name="maincontentarea" id="maincontentarea" align="left" align="top" width="85%" height="535" scrolling="auto" marginheight="0" src="main.htm" frameborder="0">
<script language="javascript">
// writes in the iframe
var contPage = (location.search.substring(1))? location.search.substring(1) : 'main.htm';
var myDomain = "shopmalm";
// now check to see that myDomain is part of the content page string
var contValid = contPage.search(myDomain);
if (contValid == -1)
contPage = "main.htm";
else
contPage = unescape(contPage);
</script>
FOREIGN URL ORPHAN>>>>>>>>>>>>>
<script type="text/javascript">
if (window == top) {
var url='window.location.replace("http://www.saintjohnlutheran.net/?var1='+window.location.href+'")';
eval(url);
}
</script>
My problem is that instead of forcing a orphan page 'main.htm" to open inside a (outside URL) page parent 'index.htm' , My orphah pages are seach results and look like this 'dwos-bin/dynamic2.pl?nccust=malmco&code=154253'
and upon reloading i get 'dwos-bin/dynamic2.pl?nccust=malmco&code=154253.htm' as the new iframe
I would be most greatful, if anyone knows the answer to this.



Reply With Quote


Bookmarks