Forum Moderators: open

Message Too Old, No Replies

What's wrong with outputting an iframe with document.write();?

         

irock

1:09 am on Oct 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have the following but it doesn't seem to be working. Do you guys know why?
<script language="JavaScript">
var imageurl = 'http://www.mydomain.com/externalimage.php?size=large&pictureurl=../images/blahblah.jpg';
var Itr='<iframe src="'+imageurl+'" scrolling=no width=100 height=150 marginwidth=0 marginheight=0 frameborder=0 border=0>';
document.write(Itr);
</script>

Any hints?

Thanks!

tedster

2:30 am on Oct 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



At first look, does your code close the iframe tag anywhere? </iframe>? This script doesn't, so it would have to be in the HTML somewhere.

Also, you might try escaping the double quote character \" instead of " so the js parser doesn't get confused.