Alphamonkey
07-16-2007, 06:49 AM
I get an error on line 6...which is if (iframe.src="news.php")
i get Error:'null' is null or not an object
<!--
function checkPage()
{
var iframe = document.getElementById('main');
var news = 'news';
if (iframe.src="news.php")
{
document.write(news);
}
}
//-->
This code is used in an html page with an iframe with id="main"
here is the iframe
<iframe id="main" onLoad="calcHeight();" scrolling="no" frameborder="no" name="main" width="100%" src="news.php"></iframe>
calcHeight is a different javascript function in a different javascript file that works fine
here is how i call the javascript...ill post it to make sure im not doing this one wrong
<head><script type="text/javascript" src="script/checkpage.js"></script></head>
i get Error:'null' is null or not an object
<!--
function checkPage()
{
var iframe = document.getElementById('main');
var news = 'news';
if (iframe.src="news.php")
{
document.write(news);
}
}
//-->
This code is used in an html page with an iframe with id="main"
here is the iframe
<iframe id="main" onLoad="calcHeight();" scrolling="no" frameborder="no" name="main" width="100%" src="news.php"></iframe>
calcHeight is a different javascript function in a different javascript file that works fine
here is how i call the javascript...ill post it to make sure im not doing this one wrong
<head><script type="text/javascript" src="script/checkpage.js"></script></head>