Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to avoid URl encoding for SRC attribute in IMG tag  RSS feed

 
Abhilesh Khatri
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing a problem with <IMG> tag.
In my application i need to construct source attribute of the IMG tag dynamically. I have imgaes created accorindly.
ON of the iMage nme is "Disney Channel". THere for the src attribute of the Img tag is bound to /Disney Channel.gif.
With this it is searching for the image /Disney%20Channel.gif!
The image file i have is Disney Channel.gif. Due to this mismatch i am unable to display the image on the browser.
I need to know work around for this situation. Simple way would be to rename the image name itself to 'Disney%20Channel.gif' instead of 'Disney Channel.gif'. BUt this is not the best approach. Is there a simpler and better way of handling this situation?
Thanks
Venkatesh/Abhilesh
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you're going to go through the effort to rename your image files -- I'd remove the space entirely. Some browsers (like older versions of netscape) don't do well with a space in a file name unless it IS encoded.
I'm surprised that it doesn't work with the encoding.
 
Abhilesh Khatri
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jessica Sant:
if you're going to go through the effort to rename your image files -- I'd remove the space entirely. Some browsers (like older versions of netscape) don't do well with a space in a file name unless it IS encoded.
I'm surprised that it doesn't work with the encoding.

Ultimately thsts what i ended up doing. I removed the spaces in between the names of the image. This works fine.
Thanks for your comments
venkatesh
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!