What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Links ending with a )

Links ending with a )
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Links ending with a )
quote:
Originally posted by Eljay
Unfortunately, using encodeURI doesn't encode parentheses (it appears JScript 5.6 is older than the latest RFC about URIs :P) so it doesn't really help.
Hence why I suggest to use escape() instead (in this situation).

The reason why they suggest not to use escape() has to do with how it handles other characters (eg: it encodes some characters which don't need to be encoded) and that it, therefor, can't be used on a complete link (eg: it also encodes ":" in the "http://" part, and the ampersand & and equal sign = in a query string).

But this is better than not encoding certain characters which should best be encoded (like the parenthesis).

In short, for 'simple' links, in ascii format, without any query components or anchors, the escape() method is a proper (and safer) method to use though as long as you don't include the "http://" part.

Ori: http://www.this.com/that.html (spaced)?data1=1&data2=1#anchor4
escape() => http%3A//www.this.com/that.html%20%28spaced%29%3Fdata1%3D1%26data2%3D1%23anchor4
encodeURI() => http://www.this.com/that.html%20(spaced)?data1=1&data2=1#anchor4


http://xkr.us/articles/javascript/encode-compare/
http://www.the-art-of-web.com/javascript/escape/

This post was edited on 07-25-2010 at 06:10 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
07-25-2010 05:33 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Links ending with a ) - by macgyver08 on 07-23-2010 at 08:57 AM
RE: Links ending with a ) - by CookieRevised on 07-23-2010 at 10:14 AM
RE: Links ending with a ) - by macgyver08 on 07-23-2010 at 11:40 AM
RE: Links ending with a ) - by Chris4 on 07-23-2010 at 02:53 PM
RE: Links ending with a ) - by matty on 07-24-2010 at 06:49 PM
RE: Links ending with a ) - by CookieRevised on 07-25-2010 at 01:41 PM
RE: Links ending with a ) - by Eljay on 07-25-2010 at 02:29 PM
RE: Links ending with a ) - by CookieRevised on 07-25-2010 at 05:33 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On