SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Images not displaying in Google Chrome

    Hi All,

    I have an html page for displaying images, but one of image in that page is not displaying in google chrome but all other browsers like firefox,opera is displaying the images correctly.
    The code is like <img src="image/angels/Alena\'s Angels Flyer_t.jpg"/>, i think that may be due to escaping(\) ( we can not change the image name ) , but the image issues is only in chrome . If anyone knows the solution please help me Thanks in advance...

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,217
    Mentioned
    457 Post(s)
    Tagged
    8 Thread(s)
    Don't have an apostrophe in a file name like that. It's not practical at all. Just be creative and make it something like "Alena-Angels-Flyer_t.jpg". It's also a good idea not to have spaces in your online file names, as it makes for ugly URLs.

  3. #3
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    I don't see why you cannot change the image name but it would most likely translate to the following: <img src="image/angels/Alena\'s%20Angels%20Flyer_t.jpg" alt="" /> though if possible you should change the filename to something more sensible as the backslash (Hex 5C) is not a good idea at all unless maybe it was relating to a dynamic modification by a script.

  4. #4
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Location
    Keene, NH
    Posts
    3,760
    Mentioned
    23 Post(s)
    Tagged
    0 Thread(s)
    That slash needs to go -- URL's are not escaped by slashes... so that's being treated as a literal. "can't change the name" just means "can't make it work on the web".

    What are you using to generate the filename in the first place? Is it literally on the drive without the forward slash? If so, you need to get rid of that slash.

    As a rule of thumb, it's ALWAYS a bad idea to use anything more than a..z, A..Z, 0..9, _, . or + in filenames without using the %XX escape codes.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •