Forum Moderators: open
<script type="text/javascript">
//<![CDATA[
var cnetproductname = 'Buffalo';
var id = '32432443';
var type = 'reviews';
document.write('<iframe id="myFrame" frameborder=0 scrolling=no width=100% src="http://www.domain.com/grab.php?productname=' + productname + '&id=' + id + '&type=' + type + '&embed=0" onload="adjustMyFrameSize();" >');
//]]>
</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="language" content="english">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>untitled document</title>
<script type="text/javascript">
function init(){
cnetproductname='Buffalo';
id='32432443';
type='reviews';
f=document.createElement('iframe');
f.setAttribute('id','myFrame');
f.setAttribute('frameborder',0);
f.setAttribute('scrolling','no');
f.setAttribute('width','100%');
f.setAttribute('src','http://www.domain.com/grab.php?productname='+
cnetproductname+'&id='+id+'&type='+type+'&embed="0"');
f.setAttribute('onload','adjustMyFrameSize()'); [red]/*IE returns "undefined" for "onload" */[/red]
document.getElementById('iframe-container').appendChild(f);
if(isIE=/*@cc_on!@*/false){
setTimeout(function(){adjustMyFrameSize()},5000);
}
}
function adjustMyFrameSize(){
alert('function adjustMyFrameSize is initiated')
}
if(window.addEventListener){
window.addEventListener('load',init,false);
}
else {
if(window.attachEvent){
window.attachEvent('onload',init);
}
}
</script>
</head>
<body>
<div id="iframe-container">
</div>
</body>
</html>
No problem, you're very welcome. ;)
Sorry for asking a dumb question.
I'm sorry, but how do I print out the result? Do I have to put something
inside to make this work? Sorry for asking a dumb question.
<span id="target_span"> </span> document.getElementById('target_span').firstChild.nodeValue='Hi Mom!';