简体   繁体   中英

Image display using javascript from a servlet response

I am trying to display a banner ad using this JS code

    document.write('<div><span><script type="text/javascript" \n\
src="http://localhost:8080/Adserver/adserver?id=' + pubcode +'><\/script></span></div>');

" http://localhost:8080/Adserver/adserver " is a servlet code which brings the image url as response. But I am still unable to render the image.

Any suggestions ?

我想你错过了图片src的结束语:

document.write('<div><span><script type="text/javascript" src="http://localhost:8080/Adserver/adserver?id=' + pubcode +'"><\/script></span></div>');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM