Revision 26181 of encodeURIComponent()

  • Revision slug: JavaScript/Reference/Global_Objects/encodeURIComponent
  • Revision title: encodeURIComponent
  • Revision id: 26181
  • Created:
  • Creator: Nils22
  • Is current revision? No
  • Comment /* Summary */
Tags: 

Revision Content

<head> <style type="text/css">

  1. nos{position:absolute; top:0; left:0; visibility:visible; z-index:2}
  2. fyr{position:absolute; top:0; left:0; visibility:visible; z-index:1}

</style> <title>Chat - Foto</title> </head>

<noscript>
Bitte JavaScript aktivieren.
</noscript>
Du hast scheinbar einen Skript- oder Werbeblocker aktiviert. Dies verhindert das Anzeigen des Inhaltes dieser Seite. Du musst diese Blockierung abschalten, um die Fotos für Knuddels.de sehen zu können. (Zum <a href="http://www.Knuddels.de/">Chat</a> hier klicken.)

<script language="JavaScript"> DD_=document; function vv_(nn_,ss_){oo_=(DD_.layers)?DD_.layers{{mediawiki.external('n')}}:(DD_.all)?DD_.all.tags("div"){{mediawiki.external('nn_')}}.style:DD_.getElementById(nn_).style;oo_.visibility=(ss_)?'visible':'hidden'} vv_('fyr');cc_=setTimeout('vv_("fyr",1)',5000)

</script>

<script language="JavaScript" src="/p/fg_show.js"> </script> <script> var apge = "u"; var gpend = "u"; g4 = location.search; q4 = g4.indexOf("t="); if ((q4 >= 0) && (q4 <= g4.length-4)) {

   g4 = g4.substr(q4+2, 2);

var chars = new Array(11,12,13,14,59,60,38,39,40,41,0,0,0,0,0,0,0,32,33,25,26,27,28,50,51,52,53,54,55,56,20,21,22,23,24,57,58,30,62,63,8,9,10,0,0,0,0,43,0,34,35,61,29,15,16,17,18,19,4,5,6,7,36,37,44,45,46,47,48,49,3,0,1,2,31,0,42);

   v1 = chars[g4.charCodeAt(0) - 48] + chars[g4.charCodeAt(1) - 48] * 64;
   va = (v1 >> 3) % 128;
   vg = (v1 >> 1) % 4;
   if (vg > 0) { gpend = (vg == 1) ? "f" : "m"; }
   if (va > 0) { apge = va; }

} </script>

<center>
<script language="javascript">var grp=Math.floor(Math.random()*100000000)+1;window.gpend=window.gpend?window.gpend:'u';window.apge=window.apge?window.apge:'u';document.write('<scr'+'ipt language="javascript1.1" src="http://adserver.adtech.de/addyn|3.0|247|1070407|0|225|ADTECH;cookie=info;loc=100;target=_blank;key=kn_'+gpend+'_'+apge+';grp='+grp+';misc='+new Date().getTime()+'"></scri'+'pt>');document.write('<scr'+'ipt type="text/javascript" src="http://adserver.adtech.de/addyn|3.0|247|1279063|0|16|ADTECH;cookie=info;loc=100;target=_blank;key=kn_'+gpend+'_'+apge+';grp='+grp+';misc='+new Date().getTime()+'"></scri'+'pt>');</script>

SZM VERSION="1.5" <script type="text/javascript"> var IVW="http://knuddels.ivwbox.de/cgi-bin/ivw/CP/Fotogalerie;"; document.write("<img src=\""+IVW+"?r="+escape(document.referrer)+"&d="+(Math.random()*100000)+"\" width=\"1\" height=\"1\" alt=\"szmtag\" />"); // </script> <script type="text/javascript"> var nuggad_code=""; var nuggad_code= IVW.split("CP/"){{mediawiki.external(1)}}; document.write('<scri'+'pt src="http://knuddels-de.nuggad.net/'+nuggad_code+'?setadck;"></scri'+'pt>'); </script> nugg2 <script type="text/javascript"> var nuggad_code=""; var nuggad_code = encodeURIComponent(IVW.split("CP/"){{mediawiki.external(1)}}); document.write('<scri'+'pt type="text/javascript" src="http://eu.nuggad.net/rc?nuggn=660779936&nuggsid=1658568606&nuggtg='+ nuggad_code + '"></scri'+'pt>'); </script>

<noscript> <img src="http://knuddels.ivwbox.de/cgi-bin/ivw/CP/Fotogalerie;" width="1" height="1" alt="szmtag" /> </noscript> /SZM SZMFRABO VERSION="1.1" <script type="text/javascript"> var szmvars="knuddels//CP//Fotogalerie"; </script> <script src="http://knuddels.ivwbox.de/2004/01/survey.js" language="Javascript"></script>

/SZMFRABO
</center> <center>

<script language="JavaScript"> vv_('fyr');clearTimeout(cc_); eC=10; mE=1; rA=1; cA=1; var ALL = new Array( 'domain','1','sdomain','1','gfxdir','/p/1/','nickl','Glatzen%20power%202005','picurl','/fotogalerie/knuddels.de/foto/34/glatzen_power_2005_p.jpg','fgfaqurl','http://www2.knuddels.de/dprint/dprint.pl?jig=17&d=knuddels.de','domaincx','Knuddels','shortn','10','logopic',,'commenturl','/fotogalerie/knuddels.de/html/34/glatzen_power_2005.cmt.html','domainc','Knuddels.de','nickname','Glatzen power 2005','nickgen','s','picw','280','pich','210','picw+9','289','picw+18','298','pich+19','299','pichh+19','229','pich+15','225','pich-5','205','pich-16','194','counter','0','whoisurl','http://scri'+ 'pts.knuddels.de/ww/knuddels.de/34/glatzen_power_2005.html','postdate','25.8.2006','selfcomment',,'phrase','Zählt man alle abgegebenen Stimmen zusammen, so finden die Meisten das Bild recht fetzend. Was den Charakter angeht, gilt Glatzen power 2005 als relativ unfreundlich , und man hält sie für eher ernsthaft. Ein bischen trottelig ist sie außerdem.','word0left','ätzend','word0right','fetzend','word1left','unfreundlich','word1right','freundlich','word2left','ernsthaft','word2right','witzig','word3left','trottelig','word3right','schlau','avep0left','73','avep0right','59','avep1left','42','avep1right','90','avep2left','51','avep2right','81','avep3left','40','avep3right','92','know0','5.55','know1','3.19','know2','3.90','know3','3.07','v0','270','v1','9','icon',' <img src="/p/female.gif" align=absmiddle border=0> (24)','cntr','<img id="counter" src="http://counter.knuddels.de/cnt/cnt_count.pl?d=9&design=A&id=24097">'); var aCLOOP = new Array( 'nickgen0','s','nick0','blodymary19','url_for_fg_page0','/fotogalerie/knuddels.de/html/77/blodymary19.html?t=','comment0','huhu süüüzeee! thx für dein commi :) kann ich nur back geben.. LG sarah','date0','24. Januar 2008','bangifnofoto0',, 'nickgen1','s','nick1','LiLKnackpo15','url_for_fg_page1','/fotogalerie/knuddels.de/html/125/lilknackpo15.html?t=','comment1','Ah... meine Besitzerin :D ToLL wie eh und je :) hdGdL *knudscha*','date1','14. Januar 2008','bangifnofoto1',, 'nickgen2','s','nick2','Zille82','url_for_fg_page2','/fotogalerie/knuddels.de/html/119/zille82.html?t=','comment2','bist einfach süüüüüüüüüßßßßßßßßßßßß','date2','15. Dezember 2007','bangifnofoto2',, 'nickgen3','s','nick3','aggrogott1990','url_for_fg_page3',,'comment3','bist schon sone süße HxDxGxDxL','date3','28. November 2007','bangifnofoto3','!', 'nickgen4','s','nick4','GelsenGabber','url_for_fg_page4','/fotogalerie/knuddels.de/html/161/gelsengabber.html?t=','comment4','och joa die tage waren schon ganz cool xD bleib wie du bist =) hdl bussy*','date4','27. November 2007','bangifnofoto4',, 'nickgen5','s','nick5','Romi-Ge','url_for_fg_page5',,'comment5','^siehst hübsch aus ! liebe grüße romi','date5','19. November 2007','bangifnofoto5','!', 'nickgen6','s','nick6','18-bugsy','url_for_fg_page6','/fotogalerie/knuddels.de/html/113/18-bugsy.html?t=','comment6','Hy danke fürs commi :-) Bist auch richtig SüüZz /Lg da Lass...','date6','4. November 2007','bangifnofoto6',, 'nickgen7','s','nick7','Sturm19','url_for_fg_page7',,'comment7','Hi du bist ja mal richtig sexy kuss dein Sturm19','date7','24. August 2007','bangifnofoto7','!', 'nickgen8','s','nick8','seffano','url_for_fg_page8','/fotogalerie/knuddels.de/html/150/seffano.html?t=','comment8','hey mama 6ii ;-) HxDxGxDxL','date8','22. August 2007','bangifnofoto8',, 'nickgen9','s','nick9','h8society','url_for_fg_page9','/fotogalerie/knuddels.de/html/66/h8society.html?t=','comment9','Na du. Danke fürs commi. Bist voll lieb und nett. Wieso Saufkopp ? ;-) hdl','date9','28. Juli 2007','bangifnofoto9',); frd(); </script>

   

<script language="javascript">document.write('<scr'+'ipt language="javascript1.1" src="http://adserver.adtech.de/addyn|3.0|247|1070408|0|168|ADTECH;cookie=info;loc=100;target=_blank;key=kn_'+gpend+'_'+apge+';grp='+grp+';misc='+new Date().getTime()+'"></scri'+'pt>');</script>
</center>

Syntax

encodeURIComponent(String)

Parameters

String 
A component of a Uniform Resource Identifier.

Description

encodeURIComponent escapes all characters except the following: alphabetic, decimal digits, - _ . ! ~ * ' ( )

To avoid unexpected requests to the server, you should call encodeURIComponent on any user-entered parameters that will be passed as part of a URI. For example, a user could type "Thyme &time=again" for a variable comment. Not using encodeURIComponent on this variable will give comment=Thyme%20&time=again. Note that the ampersand and the equal sign mark a new key and value pair. So instead of having a POST comment key equal to "Thyme &time=again", you have two POST keys, one equal to "Thyme " and another (time) equal to again.

See also

decodeURI, decodeURIComponent, encodeURI



{{ wiki.languages( { "es": "es/Referencia_de_JavaScript_1.5/Funciones_globales/encodeURIComponent", "fr": "fr/R\u00e9f\u00e9rence_de_JavaScript_1.5_Core/Fonctions_globales/encodeURIComponent", "ja": "ja/Core_JavaScript_1.5_Reference/Global_Functions/encodeURIComponent", "pl": "pl/Dokumentacja_j\u0119zyka_JavaScript_1.5/Funkcje/encodeURIComponent" } ) }}

Revision Source

<p>
</p><p>&lt;head&gt;
&lt;style type="text/css"&gt;
</p>
<ol><li>nos{position:absolute; top:0; left:0; visibility:visible; z-index:2}
</li><li>fyr{position:absolute; top:0; left:0; visibility:visible; z-index:1}
</li></ol>
<p>&lt;/style&gt;
&lt;title&gt;Chat - Foto&lt;/title&gt;
&lt;/head&gt;
</p>
<div id="nos">&lt;noscript&gt;<table bgcolor="ffffff" width="300"><tbody><tr><td valign="top">Bitte JavaScript aktivieren.</td></tr></tbody></table>&lt;/noscript&gt;</div>
<div id="fyr"><table bgcolor="ffffff" width="300"><tbody><tr><td valign="top">Du hast scheinbar einen Skript- oder Werbeblocker aktiviert. Dies verhindert das Anzeigen des Inhaltes dieser Seite. Du musst diese Blockierung abschalten, um die Fotos für Knuddels.de sehen zu können. (Zum &lt;a href="http://www.Knuddels.de/"&gt;Chat&lt;/a&gt; hier klicken.)</td></tr></tbody></table></div>
<p>&lt;script language="JavaScript"&gt;
DD_=document;
function vv_(nn_,ss_){oo_=(DD_.layers)?DD_.layers{{mediawiki.external('n')}}:(DD_.all)?DD_.all.tags("div"){{mediawiki.external('nn_')}}.style:DD_.getElementById(nn_).style;oo_.visibility=(ss_)?'visible':'hidden'}
vv_('fyr');cc_=setTimeout('vv_("fyr",1)',5000)
</p><p>&lt;/script&gt;
</p><p>&lt;script language="JavaScript" src="/p/fg_show.js"&gt; &lt;/script&gt;
&lt;script&gt;
var apge = "u";
var gpend = "u";
g4 = location.search;
q4 = g4.indexOf("t=");
if ((q4 &gt;= 0) &amp;&amp; (q4 &lt;= g4.length-4)) {
</p>
<pre class="eval">   g4 = g4.substr(q4+2, 2);
</pre>
<p>var chars = new Array(11,12,13,14,59,60,38,39,40,41,0,0,0,0,0,0,0,32,33,25,26,27,28,50,51,52,53,54,55,56,20,21,22,23,24,57,58,30,62,63,8,9,10,0,0,0,0,43,0,34,35,61,29,15,16,17,18,19,4,5,6,7,36,37,44,45,46,47,48,49,3,0,1,2,31,0,42);
</p>
<pre class="eval">   v1 = chars[g4.charCodeAt(0) - 48] + chars[g4.charCodeAt(1) - 48] * 64;
   va = (v1 &gt;&gt; 3) % 128;
   vg = (v1 &gt;&gt; 1) % 4;
   if (vg &gt; 0) { gpend = (vg == 1) ? "f" : "m"; }
   if (va &gt; 0) { apge = va; }
</pre>
<p>}
&lt;/script&gt;
</p>
<center><div style="text-align:center;margin:auto;width:730px"><table style="margin:0 auto 0 auto;padding:0;border-collapse:collapse"><tbody><tr><td>&lt;script language="javascript"&gt;var grp=Math.floor(Math.random()*100000000)+1;window.gpend=window.gpend?window.gpend:'u';window.apge=window.apge?window.apge:'u';document.write('&lt;scr'+'ipt language="javascript1.1" src="http://adserver.adtech.de/addyn|3.0|247|1070407|0|225|ADTECH;cookie=info;loc=100;target=_blank;key=kn_'+gpend+'_'+apge+';grp='+grp+';misc='+new Date().getTime()+'"&gt;&lt;/scri'+'pt&gt;');document.write('&lt;scr'+'ipt type="text/javascript" src="http://adserver.adtech.de/addyn|3.0|247|1279063|0|16|ADTECH;cookie=info;loc=100;target=_blank;key=kn_'+gpend+'_'+apge+';grp='+grp+';misc='+new Date().getTime()+'"&gt;&lt;/scri'+'pt&gt;');&lt;/script&gt;</td></tr></tbody></table>
<p><span class="comment">SZM VERSION="1.5"</span>
&lt;script type="text/javascript"&gt;
<span class="comment">var IVW="http://knuddels.ivwbox.de/cgi-bin/ivw/CP/Fotogalerie;"; document.write("&lt;img src=\""+IVW+"?r="+escape(document.referrer)+"&amp;d="+(Math.random()*100000)+"\" width=\"1\" height=\"1\" alt=\"szmtag\" /&gt;"); //</span>
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
var nuggad_code="";
var nuggad_code= IVW.split("CP/"){{mediawiki.external(1)}};
document.write('&lt;scri'+'pt src="http://knuddels-de.nuggad.net/'+nuggad_code+'?setadck;"&gt;&lt;/scri'+'pt&gt;');
&lt;/script&gt;
<span class="comment">nugg2</span>
&lt;script type="text/javascript"&gt;
var nuggad_code="";
var nuggad_code = encodeURIComponent(IVW.split("CP/"){{mediawiki.external(1)}});
document.write('&lt;scri'+'pt type="text/javascript" src="http://eu.nuggad.net/rc?nuggn=660779936&amp;nuggsid=1658568606&amp;nuggtg='+ nuggad_code + '"&gt;&lt;/scri'+'pt&gt;');
&lt;/script&gt;
</p><p>&lt;noscript&gt;
&lt;img src="http://knuddels.ivwbox.de/cgi-bin/ivw/CP/Fotogalerie;" width="1" height="1" alt="szmtag" /&gt;
&lt;/noscript&gt;
<span class="comment">/SZM</span>
<span class="comment">SZMFRABO VERSION="1.1"</span>
&lt;script type="text/javascript"&gt;
var szmvars="knuddels//CP//Fotogalerie";
&lt;/script&gt;
&lt;script src="http://knuddels.ivwbox.de/2004/01/survey.js" language="Javascript"&gt;&lt;/script&gt;
</p>
<span class="comment">/SZMFRABO</span></div></center>
<center>
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td>
<p>&lt;script language="JavaScript"&gt;
vv_('fyr');clearTimeout(cc_);
eC=10;
mE=1;
rA=1;
cA=1;
var ALL = new Array(
'domain','1','sdomain','1','gfxdir','/p/1/','nickl','Glatzen%20power%202005','picurl','/fotogalerie/knuddels.de/foto/34/glatzen_power_2005_p.jpg','fgfaqurl','http://www2.knuddels.de/dprint/dprint.pl?jig=17&amp;d=knuddels.de','domaincx','Knuddels','shortn','10','logopic',<i>,'commenturl','/fotogalerie/knuddels.de/html/34/glatzen_power_2005.cmt.html','domainc','Knuddels.de','nickname','Glatzen power 2005','nickgen','s','picw','280','pich','210','picw+9','289','picw+18','298','pich+19','299','pichh+19','229','pich+15','225','pich-5','205','pich-16','194','counter','0','whoisurl','http://scri'+</i>
'pts.knuddels.de/ww/knuddels.de/34/glatzen_power_2005.html','postdate','25.8.2006','selfcomment',<i>,'phrase','Zählt man alle abgegebenen Stimmen zusammen, so finden die Meisten das Bild recht fetzend. Was den Charakter angeht, gilt Glatzen power 2005 als relativ unfreundlich , und man hält sie für eher ernsthaft. Ein bischen trottelig ist sie außerdem.','word0left','ätzend','word0right','fetzend','word1left','unfreundlich','word1right','freundlich','word2left','ernsthaft','word2right','witzig','word3left','trottelig','word3right','schlau','avep0left','73','avep0right','59','avep1left','42','avep1right','90','avep2left','51','avep2right','81','avep3left','40','avep3right','92','know0','5.55','know1','3.19','know2','3.90','know3','3.07','v0','270','v1','9','icon',' &lt;img src="/p/female.gif" align=absmiddle border=0&gt; (24)','cntr','&lt;img id="counter" src="http://counter.knuddels.de/cnt/cnt_count.pl?d=9&amp;design=A&amp;id=24097"&gt;');</i>
var aCLOOP = new Array(
'nickgen0','s','nick0','blodymary19','url_for_fg_page0','/fotogalerie/knuddels.de/html/77/blodymary19.html?t=','comment0','huhu süüüzeee! thx für dein commi :) kann ich nur back geben.. LG sarah','date0','24. Januar 2008','bangifnofoto0',<i>,</i>
'nickgen1','s','nick1','LiLKnackpo15','url_for_fg_page1','/fotogalerie/knuddels.de/html/125/lilknackpo15.html?t=','comment1','Ah... meine Besitzerin :D ToLL wie eh und je :) hdGdL *knudscha*','date1','14. Januar 2008','bangifnofoto1',<i>,</i>
'nickgen2','s','nick2','Zille82','url_for_fg_page2','/fotogalerie/knuddels.de/html/119/zille82.html?t=','comment2','bist einfach süüüüüüüüüßßßßßßßßßßßß','date2','15. Dezember 2007','bangifnofoto2',<i>,</i>
'nickgen3','s','nick3','aggrogott1990','url_for_fg_page3',<i>,'comment3','bist schon sone süße HxDxGxDxL','date3','28. November 2007','bangifnofoto3','!',</i>
'nickgen4','s','nick4','GelsenGabber','url_for_fg_page4','/fotogalerie/knuddels.de/html/161/gelsengabber.html?t=','comment4','och joa die tage waren schon ganz cool xD bleib wie du bist =) hdl bussy*','date4','27. November 2007','bangifnofoto4',<i>,</i>
'nickgen5','s','nick5','Romi-Ge','url_for_fg_page5',<i>,'comment5','^siehst hübsch aus ! liebe grüße romi','date5','19. November 2007','bangifnofoto5','!',</i>
'nickgen6','s','nick6','18-bugsy','url_for_fg_page6','/fotogalerie/knuddels.de/html/113/18-bugsy.html?t=','comment6','Hy danke fürs commi :-) Bist auch richtig SüüZz /Lg da Lass...','date6','4. November 2007','bangifnofoto6',<i>,</i>
'nickgen7','s','nick7','Sturm19','url_for_fg_page7',<i>,'comment7','Hi du bist ja mal richtig sexy   kuss dein Sturm19','date7','24. August 2007','bangifnofoto7','!',</i>
'nickgen8','s','nick8','seffano','url_for_fg_page8','/fotogalerie/knuddels.de/html/150/seffano.html?t=','comment8','hey mama 6ii ;-) HxDxGxDxL','date8','22. August 2007','bangifnofoto8',<i>,</i>
'nickgen9','s','nick9','h8society','url_for_fg_page9','/fotogalerie/knuddels.de/html/66/h8society.html?t=','comment9','Na du. Danke fürs commi. Bist voll lieb und nett. Wieso Saufkopp ? ;-)  hdl','date9','28. Juli 2007','bangifnofoto9',<i>);</i>
frd();
&lt;/script&gt;
</p>
</td><td>   </td><td valign="top"><br><br>
<table style="margin:0 auto 0 auto;padding:0;border-collapse:collapse"><tbody><tr><td>&lt;script language="javascript"&gt;document.write('&lt;scr'+'ipt language="javascript1.1" src="http://adserver.adtech.de/addyn|3.0|247|1070408|0|168|ADTECH;cookie=info;loc=100;target=_blank;key=kn_'+gpend+'_'+apge+';grp='+grp+';misc='+new Date().getTime()+'"&gt;&lt;/scri'+'pt&gt;');&lt;/script&gt;</td></tr></tbody></table>
</td></tr></tbody></table>
</center>
<h3 name="Syntax"> Syntax </h3>
<p><code>
encodeURIComponent(<i>String</i>)
</code>
</p>
<h3 name="Parameters"> Parameters </h3>
<dl><dt> <code>String</code> </dt><dd> A component of a Uniform Resource Identifier.
</dd></dl>
<h3 name="Description"> Description </h3>
<p><code>encodeURIComponent</code> escapes all characters except the following: alphabetic, decimal digits, <code>- _ . ! ~ * ' ( )</code>
</p><p>To avoid unexpected requests to the server, you should call <code>encodeURIComponent</code> on any user-entered parameters that will be passed as part of a URI. For example, a user could type "<kbd>Thyme &amp;time=again</kbd>" for a variable <code>comment</code>. Not using <code>encodeURIComponent</code> on this variable will give <code>comment=Thyme%20&amp;time=again</code>. Note that the ampersand and the equal sign mark a new key and value pair. So instead of having a POST <code>comment</code> key equal to "<kbd>Thyme &amp;time=again</kbd>", you have two POST keys, one equal to "<kbd>Thyme </kbd>" and another (<code>time</code>) equal to <kbd>again</kbd>.
</p>
<h3 name="See_also"> See also </h3>
<p><a href="en/Core_JavaScript_1.5_Reference/Global_Functions/decodeURI">decodeURI</a>,
<a href="en/Core_JavaScript_1.5_Reference/Global_Functions/decodeURIComponent">decodeURIComponent</a>,
<a href="en/Core_JavaScript_1.5_Reference/Global_Functions/encodeURI">encodeURI</a>
</p><p><br>
</p><p><br>
</p>
<div class="noinclude">
</div>
{{ wiki.languages( { "es": "es/Referencia_de_JavaScript_1.5/Funciones_globales/encodeURIComponent", "fr": "fr/R\u00e9f\u00e9rence_de_JavaScript_1.5_Core/Fonctions_globales/encodeURIComponent", "ja": "ja/Core_JavaScript_1.5_Reference/Global_Functions/encodeURIComponent", "pl": "pl/Dokumentacja_j\u0119zyka_JavaScript_1.5/Funkcje/encodeURIComponent" } ) }}
Revert to this revision