PDA

View Full Version : When I set up like two websites on one page how do I......


snakewithatilda
12-04-2002, 12:11 AM
What I am trying to do is set up two websites on one page. When i click on a link I want it to open up inside the window that link was in. here is my script.

<script language="javascript">
<!--





var displaymode=0

var iframecode='<iframe id="external" style="width:50%%;height:200px" src="http://www.angelfire.com/ma4/theholydragons"></iframe>'

if (displaymode==0)
document.write(iframecode)

function jumpto(inputurl){
if (document.getElementById&&displaymode==0)
document.getElementById("external").src=inputurl
else if (document.all&&displaymode==0)
document.all.external.src=inputurl
else{
if (!window.win2||win2.closed)
win2=window.open(inputurl)
//else if win2 already exists
else{
win2.location=inputurl
win2.focus()
}
}
}
//-->
</script>
<script language="javascript">
<!--





var displaymode=0

var iframecode='<iframe id="external" style="width:50%%;height:200px" src="http://www.hotmail.com"></iframe>'

if (displaymode==0)
document.write(iframecode)

function jumpto(inputurl){
if (document.getElementById&&displaymode==0)
document.getElementById("external").src=inputurl
else if (document.all&&displaymode==0)
document.all.external.src=inputurl
else{
if (!window.win2||win2.closed)
win2=window.open(inputurl)
//else if win2 already exists
else{
win2.location=inputurl
win2.focus()
}
}
}
//-->
</script>

glenngv
12-04-2002, 07:01 AM
If I understand you right, then jumpto() function is not necessary.
Plain html would do it:

//add name of the iframe
var iframecode='<iframe id="external" name="ifr" style="width:50%%;height:200px" src="http://www.angelfire.com/ma4/theholydragons"></iframe>'

then in your links:

<a href="http://www.google.com/" target="ifr">Google</a>

snakewithatilda
12-04-2002, 11:50 PM
Originally posted by glenngv
If I understand you right, then jumpto() function is not necessary.
Plain html would do it:

//add name of the iframe
var iframecode='<iframe id="external" name="ifr" style="width:50%%;height:200px" src="http://www.angelfire.com/ma4/theholydragons"></iframe>'

then in your links:

<a href="http://www.google.com/" target="ifr">Google</a>

That works thank you :)