Welcome to WebmasterWorld Guest from 184.108.40.206 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Pubcon Platinum Sponsor 2014
How do I run ONLOAD inside document.write? irock
I kinda hope you understand what i'm trying to do here. I have a function that I want to load for iframe, but I am using document.write to display the iframe.
//<![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>
Hi there irock, I prefer to use DOM methods rather than document.write. ;) It seems that it is only IE that will not render the "onload" So the only work-around that I could think of for that browser was setTimout() Here is my code...
WOW... I didn't expect someone to provide me with a complete fix. I will try that now. Thanks man. birdbrain
No problem, you're very welcome. ;) irock
Thanks birdbrain, 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. <div id="iframe-container"> </div> birdbrain
Hi there irock,
Sorry for asking a dumb question. It's not a dumb question but I do not really sure that I understand it. ;)
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. To make it work just " Copy & Paste" the code into Notepad and save as an HTML file. birdbrain JAB Creations
<span id="target_span"> </span>
Keep in mind that if the span does not contain a string (including even an empty space) browsers will have difficulty with this. - John L33t_J0rdan
Thanks for the explanation, John. Looks like I'm not going to be using