The thing is, the string looks fine in the source. The title:
This title's got an apostrophe
is turned into:
just as I’d intended.
What I didn’t realize was that the browser would decode the URL string and allow the
%27 to behave as a
A little more research shows this to only be a problem if the string is in the
href attribute. If I put the string in an
onclick attribute, everything is hunky-dory1.
Any web or browser developers out there that can enlighten me on this one? Perhaps this is standard documented behavior and I need to handle the string in a different manner? Perhaps it’s a known bug with a good work-around?
I eagerly await waking in the morning to your sympathetic sentiments, stinging criticism and lambasting in the comments.
- Which looks like a suitable work-around, but I’d still like to understand how and why this works as it does. [back]