Jump to content
xisto Community
Sign in to follow this  
iGuest

Javascript loading iframes

Recommended Posts

Im getting this message

Line: 14Char: 3Error: 'document.getElementByID(...)' is null or not an objectCode: 0URL: http://forums.xisto.com/no_longer_exists/

when i try to run this code

<script type='text/javascript'>function setIframe() {	var url = window.location.href;	var i = url.indexOf("?i=");	if( i>-1 ) {  url = url.substr(i+3);  document.getElementById("content").src = url;	}	}window.onload = setIframe();</script>

with this url

http://forums.xisto.com/no_longer_exists/

to pull up this iframe

<iframe src="home.html" WIDTH=505 HEIGHT=420 name="body" id="content"></iframe>

with this source

full_site_part_1.html

Im putting my tutorials up on a site and i need to have a link that loads the iframe with the right content. PLEASE HELP!!

Share this post


Link to post
Share on other sites

ok fixed the javascript but still no go

<script language="JavaScript" type='text/javascript'>function setIframe() {	var url = window.location.href;	var i = url.indexOf("?i=");	if( i>-1 ) {  url = url.substr(i+3);  document.getElementById("content").src = url;	}	}window.onload = "setIframe()";</script>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.