Web Analytics Made Easy -
StatCounter URL´s special codes - CodingForum

Announcement

Collapse
No announcement yet.

URL´s special codes

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • URL´s special codes

    Hello dudes, someone here knows where can i find all URL´s special caracteres? Like %20 ( that means space ), i want to know which code is \n.

    Regards,
    LottaLava

  • #2
    \n represents the notion of a newline, that is LF, CRLF, CR or NEL depending on the operative system. LF if 0a, CR is 0d.
    liorean <[[email protected]]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

    Comment


    • #3
      alert(escape('[email protected]!#$%^$%$&^%&)(*_()-_|'))
      Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

      Comment


      • #4
        I found a site that explain how to convert \n, \t and other caracter to URL encoder, we can use String.charCodeAt( ) to convert those caracters, mainly its a conversion in hex of ascii caracter´s value. For example: Space hex => 20. But just now i know that.

        Thank you,
        LottaLava

        Comment


        • #5
          As Alien51 pointed out. You can just escape the special character to get the encoded value;

          var chars = '! [email protected]!#%^$&)(*_-_|+<>=\t\r\n';
          var arr = chars.split('');
          var str = '';
          for (var i=0;i<arr.length;i++) str+=arr[i] + ' --> ' + escape(arr[i]) + '\n';
          alert(str);
          Glenn
          vBulletin Mods That Rock!

          Comment

          Working...
          X