<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4907553456984506523</id><updated>2012-02-16T07:06:06.310-08:00</updated><title type='text'>Web Development</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://worldwebmaster.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4907553456984506523/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://worldwebmaster.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Welcome to Dotnet Programmers</name><uri>http://www.blogger.com/profile/10433852605244788271</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4907553456984506523.post-3624166183026672338</id><published>2007-07-25T05:19:00.000-07:00</published><updated>2007-07-25T05:39:33.810-07:00</updated><title type='text'>JavaScript Escape Character</title><content type='html'>&lt;span style="color: rgb(0, 160, 96);font-family:impact,arial;font-size:180%;"  &gt;   JavaScript Escape Character   &lt;!-- $$$ /Main Heading $$ --&gt; &lt;/span&gt;&lt;p&gt;  &lt;!-- ************* /Header ************* --&gt; &lt;!-- ############### Body ############## --&gt;  &lt;span style="font-family:arial;"&gt;Ever need to print quotation marks in a JavaScript string.  That is not too bad, right? All you have to do is use the other set of quotation marks.  If you need to use double quotation marks in a string, then you define the string by using single quotations, that is not hard.  Now, what if you needed to use both sets of quotation marks in a string? That is a little bit harder.  In this case you could split the string into many different parts and then just append the pieces together, but that can get to be too much work, not to mention confusing.  It would be easier to take a look at the table bellow and use JavaScript's escape characters. &lt;/span&gt;&lt;/p&gt;&lt;p&gt; &lt;table border="1" cellspacing="0" width="460"&gt; &lt;tbody&gt;&lt;tr bg="" style="color: rgb(0, 160, 96);"&gt;&lt;td width="100"&gt;&lt;span style="color:white;"&gt;&lt;b&gt;Character&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;  &lt;td&gt;&lt;span style="color:white;"&gt;&lt;b&gt;Meaning&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;tt&gt;\b&lt;/tt&gt;&lt;/td&gt;  &lt;td&gt;Backspace&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;tt&gt;\f&lt;/tt&gt;&lt;/td&gt;  &lt;td&gt;Form feed&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;tt&gt;\n&lt;/tt&gt;&lt;/td&gt;  &lt;td&gt;New line&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;tt&gt;\r&lt;/tt&gt;&lt;/td&gt;  &lt;td&gt;Carriage return&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;tt&gt;\t&lt;/tt&gt;&lt;/td&gt;  &lt;td&gt;Tab&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;tt&gt;\'&lt;/tt&gt;&lt;/td&gt;  &lt;td&gt;Single quote or apostrophe (')&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;tt&gt;\"&lt;/tt&gt;&lt;/td&gt;  &lt;td&gt;Double quote (")&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;tt&gt;\\&lt;/tt&gt;&lt;/td&gt;  &lt;td&gt;Backslash (\)&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;tt&gt;\&lt;i&gt;XXX&lt;/i&gt;&lt;/tt&gt;&lt;/td&gt;  &lt;td&gt;&lt;tt&gt;&lt;i&gt;XXX&lt;/i&gt;&lt;/tt&gt; is an octal number (between 0 and 377) that represent  the Latin-1 character equivalent.  For example &lt;tt&gt;\251&lt;/tt&gt; is the octal code for the  copyright symbol.&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;tt&gt;\x&lt;i&gt;XX&lt;/i&gt;&lt;/tt&gt;&lt;/td&gt;  &lt;td&gt;&lt;tt&gt;&lt;i&gt;XX&lt;/i&gt;&lt;/tt&gt; is a hexadecimal number (between 00 and FF) that represent  the Latin-1 character equivalent.  For example &lt;tt&gt;\xA9&lt;/tt&gt; is the hexadecimal code for the  copyright symbol.&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top"&gt;&lt;tt&gt;\u&lt;i&gt;XXXX&lt;/i&gt;&lt;/tt&gt;&lt;/td&gt;  &lt;td&gt;&lt;tt&gt;&lt;i&gt;XXXX&lt;/i&gt;&lt;/tt&gt; is a hexadecimal number (between 00 and FF) that represent  the Unicode character equivalent.  For example &lt;tt&gt;\u00A9&lt;/tt&gt; is the hexadecimal code for the  copyright symbol.&lt;br /&gt;&lt;span style="font-size:78%;"&gt;(&lt;span style="color:red;"&gt;Note:&lt;/span&gt; Unicode is only supported by JavaScript 1.3)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;/p&gt;&lt;p&gt;  &lt;span style="font-family:arial;"&gt;The string &lt;tt&gt;"\tTom said \"Hello to everyone!\"\nSo did Mary."&lt;/tt&gt; would print: &lt;/span&gt;&lt;/p&gt;&lt;ul&gt;&lt;span style="font-family:arial;"&gt;&lt;tt&gt;        Tom said "Hello to everyone!"&lt;br /&gt; So did Mary. &lt;/tt&gt;&lt;/span&gt;&lt;/ul&gt;Some More Examples&lt;br /&gt;&lt;p&gt;    &lt;span style="color: rgb(128, 0, 0);"&gt;1)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;  &lt;script language="javascript"&gt;&lt;br /&gt;&lt;br /&gt;document.write('We\'re going to \"need\" to know where you\'re going tonight, young man!')&lt;/span&gt;&lt;/p&gt;&lt;p&gt; &lt;span style="font-size:-1;color:#800000;"&gt;&lt;/script&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;2)     &lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;alert('OK Then!\r\rYou want a neat box like \"this\" one?\r\rWell!\r\rYou\'ll need:\rBrains\tBeauty\t\tTalent\rMoney\tDog food\t\tLuck\rA Cat\tEye of Newt\tA Shrubbery!\r\rAnd the ability to \'read\' this tutorial.\r\rOK?')&lt;/span&gt;  &lt;/p&gt;3)&lt;br /&gt;&lt;p style="color: rgb(153, 102, 51);"&gt;Notice that because the backslash itself is used as the escape character, you cannot directly type one in your script! If you want to use a backslash, you must type two of them together (\\).&lt;/p&gt;  &lt;blockquote style="color: rgb(153, 102, 51);"&gt;&lt;p&gt;&lt;code&gt;&lt;span style="font-family:Courier New, Courier, Monospace;"&gt;document.write('The   path to the file is C:\\program files\\mystuff\\readme.txt.');&lt;br /&gt;  document.write('He thought for one moment and then said, "I really didn/'t   suspect the problem to be with the hard drive."');&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;/blockquote&gt;  &lt;p style="color: rgb(153, 102, 51);"&gt;Forgetting to use escape characters properly will result in errors in your JavaScripts.  Take care that you get them right!&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;table border="0" width="144"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;img src="http://incrediblecounters.com/counter/?id=5865&amp;style=42" usemap="#countermap42" border="0" height="25" width="144" /&gt;&lt;map name="countermap42" id="countermap42"&gt;&lt;area title="For details: www.marinenutz.com/pages/vhf_radio.html -- VHF Radio" shape="rect" coords="0,0,48,25" href="http://www.marinenutz.com/pages/vhf_radio.html" target="_blank"&gt;&lt;area title="www.incrediblecounters.com" shape="rect" coords="48,0,96,25" href="http://incrediblecounters.com/" target="_blank"&gt;&lt;area title="Click here to view your web stats and Google rank" shape="rect" coords="96,0,144,25" href="http://incrediblecounters.com/counter/stats/stats.asp?id=5865" target="_blank"&gt;&lt;/map&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr align="center"&gt;&lt;td&gt;&lt;a class="business" title="For more information: www.marinenutz.com/pages/vhf_radio.html" href="http://www.marinenutz.com/pages/vhf_radio.html" target="_blank"&gt;VHF Radio&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;!-- SiteSearch Google --&gt;&lt;br /&gt;   &lt;form method="get" action="http://www.google.co.in/custom" target="google_window"&gt;&lt;br /&gt;    &lt;table style="width: 752px; height: 240px;" bgcolor="#cccccc" border="0"&gt;&lt;br /&gt;     &lt;tbody&gt;&lt;tr&gt;&lt;br /&gt;      &lt;td align="left" height="32" nowrap="nowrap" valign="top"&gt;&lt;br /&gt;       &lt;a href="http://www.google.com/"&gt;&lt;img src="http://www.google.com/logos/Logo_25gry.gif" alt="Google" align="middle" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;      &lt;/td&gt;&lt;br /&gt;      &lt;td nowrap="nowrap"&gt;&lt;br /&gt;       &lt;input name="domains" value="yourcloths.info" type="hidden"&gt; &lt;label for="sbi" style="display: none;"&gt;&lt;br /&gt;        Enter your search terms&lt;/label&gt; &lt;input name="q" size="50" maxlength="255" id="sbi" type="text"&gt;&lt;br /&gt;       &lt;label for="sbb" style="display: none;"&gt;Submit search form&lt;/label&gt; &lt;input name="sa" value="Search" id="sbb" type="submit"&gt;&lt;br /&gt;      &lt;/td&gt;&lt;br /&gt;     &lt;/tr&gt;&lt;br /&gt;     &lt;tr&gt;&lt;br /&gt;      &lt;td&gt; &lt;/td&gt;&lt;br /&gt;      &lt;td nowrap="nowrap"&gt;&lt;br /&gt;       &lt;table&gt;&lt;br /&gt;        &lt;tbody&gt;&lt;tr&gt;&lt;br /&gt;         &lt;td&gt;&lt;br /&gt;          &lt;input name="sitesearch" value="" checked="checked" id="ss0" type="radio"&gt; &lt;label for="ss0" title="Search the Web"&gt;&lt;br /&gt;           &lt;span style="font-size:-1;color:#000000;"&gt;Web&lt;/span&gt;&lt;/label&gt;&lt;/td&gt;&lt;br /&gt;         &lt;td&gt;&lt;br /&gt;          &lt;input name="sitesearch" value="yourcloths.info" id="ss1" type="radio"&gt; &lt;label for="ss1" title="Search yourcloths.info"&gt;&lt;br /&gt;           &lt;span style="font-size:-1;color:#000000;"&gt;yourcloths.info&lt;/span&gt;&lt;/label&gt;&lt;/td&gt;&lt;br /&gt;        &lt;/tr&gt;&lt;br /&gt;       &lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;       &lt;input name="client" value="pub-9409270992342850" type="hidden"&gt; &lt;input name="forid" value="1" type="hidden"&gt;&lt;br /&gt;       &lt;input name="ie" value="ISO-8859-1" type="hidden"&gt; &lt;input name="oe" value="ISO-8859-1" type="hidden"&gt;&lt;br /&gt;       &lt;input name="cof" value="GALT:#008000;GL:1;DIV:#000000;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:3D81EE;LC:3D81EE;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1" type="hidden"&gt;&lt;br /&gt;       &lt;input name="hl" value="en" type="hidden"&gt;&lt;br /&gt;      &lt;/td&gt;&lt;br /&gt;     &lt;/tr&gt;&lt;br /&gt;    &lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;   &lt;/form&gt;&lt;br /&gt;   &lt;!-- SiteSearch Google --&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4907553456984506523-3624166183026672338?l=worldwebmaster.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://worldwebmaster.blogspot.com/feeds/3624166183026672338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4907553456984506523&amp;postID=3624166183026672338' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4907553456984506523/posts/default/3624166183026672338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4907553456984506523/posts/default/3624166183026672338'/><link rel='alternate' type='text/html' href='http://worldwebmaster.blogspot.com/2007/07/javascript-escape-character.html' title='JavaScript Escape Character'/><author><name>Welcome to Dotnet Programmers</name><uri>http://www.blogger.com/profile/10433852605244788271</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
