Tim Parkin

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromTim Parkin
ToMe
Subjecturlencoding on the popup library code
Date26 May 2005 11:46
Hi,

Just a quicky, I've been using your pop up and had a problem with ie
unencoding encoded backslashes. I've added the following line into the
script to handle this :-

    imageURL = imageURL.replace(/\\/gi, '%5C')

Added just under the popup function call..

Give me a kick if you want a little more explanation!!  :-) 

Tim
FromMe
ToTim Parkin
SubjectRe: urlencoding on the popup library code
Date26 May 2005 13:05
Tim,

> unencoding encoded backslashes.
>     imageURL = imageURL.replace(/\\/gi, '%5C')

Nice tip, especially since many browsers have error handling encode/unencode
behaviours for URLs that may do this :)

In IE's case, it is "special" since it uses backslashes in place of forward
slashes, since it is part of the Windows Explorer, where backslashes denote
folders, so this is an understandable bug.

Although I wonder why you would need backslashes in image URLs anyway, since
regular URL paths should always use forward slashes, not backslashes. But I
guess you have your reasons.

Thanks again.

Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromTim Parkin
ToMe
SubjectRe: urlencoding on the popup library code
Date26 May 2005 16:17
>> since it is part of the Windows Explorer, where
>> backslashes denote folders, so this is an understandable bug.

it was probably a 'fix' of some sort for some other bug somewhere

>> Although I wonder why you would need backslashes in image URLs anyway,
>> since regular URL paths should always use forward slashes, not
>> backslashes. But I guess you have your reasons.

 :-) 

legacy code that stores the full upload path from a windows machine onto
a linux machine (the files are called things like c:\\document\ and
\settings\\... etc)

>> Thanks again.

no problem... nice code btw!!
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.