Friday, August 29, 2008

Javascript Encode URI

To encode Uniform Resource Identifier (URI) you can use the
encodeURIComponent()
JavaScript function like this:
javascript:location.href=’http://mysite.com/bookmark.aspx?url=’ + encodeURIComponent(location.href)+’&title=’ + encodeURIComponent(document.title)

To decode the URI you can use the decodeURIComponent JavaScript function., ,

No comments:

Post a Comment