View Full Version : Bookmark code leaves %20 in browser favorite

06-01-2009, 06:03 PM
I have a site where I'm using a home-grown social bookmarking tool. The user has an option to "Bookmark this page" to their browser.

My code works, but the problem is that when I dynamically grab the document.title, the browser (both IE and FF) tries to resolve any spaces or special characters so that when the favorite is stored in the browser, the bookmark reads:


instead of:

"This Site Bookmark"

I feel like there must be a simple function to resolve spaces, but I'm coming up blank, no pun intended...:)

06-01-2009, 06:13 PM
Actually, is the "unescape" function the way to go?

Philip M
06-01-2009, 06:53 PM
Actually, is the "unescape" function the way to go?

Well, why not try it and find out?

var txt = "This%20Site%20Bookmark"

06-01-2009, 07:08 PM
That's the ticket. It looks like it strips out ":", but it's much better than leaving the %20 in there.