...

View Full Version : Image not displaying in some browsers



eacollie
10-06-2011, 01:39 PM
I have the following code to display an image (and link if there is one):



if (ads[adNumber].href)
{
tempCode += ('<a href="'+ ads[adNumber].href +'" target=_blank "> \n')
tempCode += ('<img src="' + ads[adNumber].src + '" width=' + ads[adNumber].width)
tempCode += (' onLoad="setTimeout(\'newAd();\',' + refreshTime + ');"')
tempCode += ('\n height=' + ads[adNumber].height + ' border=0 >')
tempCode += ('</a>')
}
else
{
tempCode += ('<img src="' + ads[adNumber].src + '" width=' + ads[adNumber].width)
tempCode += (' onLoad="setTimeout(\'newAd();\',' + refreshTime + ');"')
tempCode += ('\n height=' + ads[adNumber].height + ' border=0 >')
}
return tempCode;


This works OK in IE9 but only shows the image if there is no link in IE7 (that is, if (ads[adNumber].href) is not true).

Thanks for any help!

ironboy
10-06-2011, 06:50 PM
Try adding a double-quote (and removing a space) so that target=_blank " becomes target="_blank"

eacollie
10-06-2011, 08:03 PM
Thank you! Thank you! That worked beautifully!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum