SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot BobM's Avatar
    Join Date
    Jun 2000
    Location
    Tucson, AZ, USA
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question %20 being added for unknown reason

    Hi guys,

    I hope someone here can help me with this as it's been driving me crazy

    I use javascript throughout my site to create thumbnail images that when clicked on open a pop-up containing a larger version of the image. I have been using this for atleast a year now with no problems.

    Recently, I discovered that when clicking on a thumbnail nothing happens, no pop-up or anything. So, I right-clicked on the image and opened in a new window and noticed that it looks like this...

    javascript:thumbWindow('http://www.mysite.com/images/stories/Stills/2006/thedescent/poster-thedescent.jpg','The%20Descent%20poster',339,500,0);

    You'll notice that there is a %20 between each word that makes up the "Alt Text." If I remove the "Alt Text" from the image then everything works fine. I have hundreds of images using this method and I do not know how to remove the %20 from all of the descriptions, so that the pop-ups work again.

    Can someone give me an idea how I can fix this?

  2. #2
    SitePoint Enthusiast
    Join Date
    Oct 2005
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Spaces do this, get reformatted, encrypted/coded, and so I never use spaces in filenames. Never use capital letters or periods either, or symbols of any kind, causes same trouble.
    Mike

  3. #3
    SitePoint Zealot BobM's Avatar
    Join Date
    Jun 2000
    Location
    Tucson, AZ, USA
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks myst59. I'll remember that for the future.

    Is there no way to fix the problem for images that are already messed up, maybe an mysql query that will remove the alt text from all images in one shot?

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,862
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    That isn't alt text. That is the name of the new browser window and window names are not allowed to contain spaces.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


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
  •