View Full Version : Document.write not working in IE

08-01-2006, 08:58 PM
I could really use some help in trying to figure out why this is not working in IE.

I'm basically trying to pull images from a webpage using the following bookmarlet: javascript:(function(){with(j=(d=document).createElement(s='script')){type='text/'+(language='java'+s);src='http://www.regis-nyc.org/js/mark.js';}d.body.appendChild(j);})()

The js code pulls images with certain height and width parameters and displays them on the page. If you copy the above code to a FF Browser it works perfectly but when I do it in IE nothing seems to happen and I dont see any javascript errors. If I were to replace the document.write method with an alert(), the output is correct. I just cant seem to get the output to write to the browser using IE. I would really appreciate some help. Nobody can seem to solve this problem. Here is the code of the src page:


for (bb=0;bb<document.images.length;bb++)
if(document.images[bb].width > 50 && document.images[bb].width < 500 && document.images[bb].height > 50){
if(document.images[bb].height < 400 ){
if(document.images[bb].width > 399 ){ww=document.images[bb].width/4; hh=document.images[bb].height/4;}else if(document.images[bb].width > 299 ){ww=document.images[bb].width/3; hh=document.images[bb].height/3;}else if(document.images[bb].width > 199 ){ww=document.images[bb].width/2; hh=document.images[bb].height/2;}else if(document.images[bb].width > 130 ){ww=document.images[bb].width/1.5; hh=document.images[bb].height/1.5;}else{ww=document.images[bb].width; hh=document.images[bb].height;}}else if(document.images[bb].height > 299 ){

if(hh > 99){hh=hh*.7;ww=ww*.7;}
if(hh > 90){hh=hh*.7;ww=ww*.7;}

if(ll % 5 == 0){tt='</tr><tr>';}else{tt='';}

aa+=''+tt+'<td bgcolor=FFFFFF valign=bottom><center><img src='+document.images[bb].src+' border=0 width='+ww+' height='+hh+'><br><input name=\'uIMG\' type=\'radio\' value=\''+document.images[bb].src+'&sl_wwww='+ww+'&sl_hhhh='+hh+'\' /></center></td>'

document.write('<br><br><form method=\'post\' action=\'http:///post/\'><table align=center cellspacing=1 cellpadding=5 bgcolor=e1e1e1><tr><td bgcolor=FFFFFF valign=bottom><center><img src = \'http://www. .com/images/no_Image.gif\'><br><input name=\'uIMG\' type=\'radio\' checked value=\'NoImage\' /></center></td>'+aa+'</tr></table><br><center><input name=\'UID\' type=\'hidden\' value=\''+location.href+'\'><input name=\'bb\' type=\'hidden\' value=\'\'><input type=\'submit\' name=\'Submit\' value=\'Please Select an Image and Click Here\'></form>');