How to display several images in Chrome?

45 views
Skip to first unread message

yongzh...@gmail.com

unread,
Apr 10, 2015, 6:43:50 PM4/10/15
to we...@googlegroups.com
Hello all,

I figured out that we could use return <img src="./static/1.png"> <img src="./static/2.png"> <img src="./static/3.png"> in GET to display three images in the order, where 1.png-3.png are stored in /static directory. I suddenly realized that this trick work for both Firefox & IE but not for Chrome. Chrome will print out "<img src="./static/1.png"> <img src="./static/2.png"> <img src="./static/3.png">"string on the page instead of displaying them. Why Chrome has this result? What is the correct way to show several images in Chrome browser? Thanks a lot.

Best Regards,
-Yongzhi

Matteo Landi

unread,
Apr 11, 2015, 8:49:03 AM4/11/15
to we...@googlegroups.com
Maybe because the returned document is not a _complete_ HTML document (not html, no body, and so forth..)?  Try returning a valid HTML document and tell us how it goes.

Ciao,
Matteo

--
You received this message because you are subscribed to the Google Groups "web.py" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webpy+un...@googlegroups.com.
To post to this group, send email to we...@googlegroups.com.
Visit this group at http://groups.google.com/group/webpy.
For more options, visit https://groups.google.com/d/optout.

yongzh...@gmail.com

unread,
Apr 13, 2015, 5:45:30 PM4/13/15
to we...@googlegroups.com
Yes, your are right, Matteo. If I use

return """
<!DOCTYPE html>
<html>
  <body>
        <img src='./static/Image1.png'>
        <img src='./static/Image2.png'>
        <img src='./static/Image3.png'>
  <body>
</html>
"""




instead, I could get correct result in Chrome as well. Thank you so much for your help!

Best Regards,
-Yongzhi
Reply all
Reply to author
Forward
0 new messages