<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>code.commongroove.com &#187; JavaScript</title>
	<atom:link href="http://code.commongroove.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://code.commongroove.com</link>
	<description>C#, T-SQL, and general IT mojo</description>
	<lastBuildDate>Thu, 26 Jan 2012 03:00:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>JavaScript: Extending String to Have startsWith and endWith Functions</title>
		<link>http://code.commongroove.com/2011/09/09/javascript-extending-string-to-have-startswith-and-endwith-functions/</link>
		<comments>http://code.commongroove.com/2011/09/09/javascript-extending-string-to-have-startswith-and-endwith-functions/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 13:13:55 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://code.commongroove.com/?p=305</guid>
		<description><![CDATA[Here&#8217;s two prototype functions you can add to your JavaScript to give you &#8220;startsWith&#8221; and &#8220;endsWith&#8221; functions: if &#40;!String.prototype.startsWith&#41; &#123; &#160; &#160; String.prototype.startsWith = function &#40;str&#41; &#123; &#160; &#160; &#160; &#160; return this.slice&#40;0, str.length&#41; == str; &#160; &#160; &#125;; &#125; &#8230; <a href="http://code.commongroove.com/2011/09/09/javascript-extending-string-to-have-startswith-and-endwith-functions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s two prototype functions you can add to your JavaScript to give you &#8220;startsWith&#8221; and &#8220;endsWith&#8221; functions:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>String.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">startsWith</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; String.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">startsWith</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>str<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">slice</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> str.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> str<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>String.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">endsWith</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; String.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">endsWith</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>str<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">slice</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span>str.<span style="color: #660066;">length</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> str<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://code.commongroove.com/2011/09/09/javascript-extending-string-to-have-startswith-and-endwith-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery: Global AJAX Error Handler</title>
		<link>http://code.commongroove.com/2011/04/24/jquery-global-ajax-error-handler/</link>
		<comments>http://code.commongroove.com/2011/04/24/jquery-global-ajax-error-handler/#comments</comments>
		<pubDate>Sun, 24 Apr 2011 23:49:46 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://code.commongroove.com/?p=274</guid>
		<description><![CDATA[Here&#8217;s a quick and dirty way to handle AJAX errors globally if you are using jQuery: $&#40;document&#41;.ready&#40;function &#40;&#41; &#123; &#160; &#160; $.ajaxSetup&#40;&#123; &#160; &#160; &#160; &#160; error: function &#40;x, e&#41; &#123; &#160; &#160; &#160; &#160; &#160; &#160; if &#40;x.status == &#8230; <a href="http://code.commongroove.com/2011/04/24/jquery-global-ajax-error-handler/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick and dirty way to handle AJAX errors globally if you are using jQuery:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; $.<span style="color: #660066;">ajaxSetup</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; error<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>x<span style="color: #339933;">,</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>x.<span style="color: #000066;">status</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Network error'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>x.<span style="color: #000066;">status</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">404</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'404 Page not found'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>x.<span style="color: #000066;">status</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// assume msft brings error page back with a useful title</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> titleMatch <span style="color: #339933;">=</span> <span style="color: #009966; font-style: italic;">/(.*?)&lt;\/title&gt;/</span>.<span style="color: #660066;">exec</span><span style="color: #009900;">&#40;</span>x.<span style="color: #660066;">responseText</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> titleString <span style="color: #339933;">=</span> titleMatch <span style="color: #339933;">?</span> titleMatch<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Oops!<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>500 Internal Server Error<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>'</span> <span style="color: #339933;">+</span> titleString<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>e <span style="color: #339933;">==</span> <span style="color: #3366CC;">'parsererror'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Error.<span style="color: #000099; font-weight: bold;">\n</span>Parsing JSON Request failed.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>e <span style="color: #339933;">==</span> <span style="color: #3366CC;">'timeout'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Request Time out.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Unkown error: '</span> <span style="color: #339933;">+</span> x.<span style="color: #000066;">status</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">' '</span> <span style="color: #339933;">+</span> x.<span style="color: #660066;">statusText</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>'</span> <span style="color: #339933;">+</span> x.<span style="color: #660066;">responseText</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>Now, of course you most likely wouldn&#8217;t want to just use an alert() call to notify your users, but hopefully this helps get you started.  Also, using a global handler isn&#8217;t always the best option; look into using the jQuery .ajaxError() method of handling errors for specific AJAX calls as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://code.commongroove.com/2011/04/24/jquery-global-ajax-error-handler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript: Quickly Trim the Last Character from a String</title>
		<link>http://code.commongroove.com/2011/04/06/javascript-quickly-trim-the-last-character-from-a-string/</link>
		<comments>http://code.commongroove.com/2011/04/06/javascript-quickly-trim-the-last-character-from-a-string/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 17:31:01 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://code.commongroove.com/?p=269</guid>
		<description><![CDATA[When developing web applications, you undoubtedly have wanted to remove the last character from a string (such as a URL or application path)  in your JavaScript code. Here&#8217;s a quick way to get it done using the JavaScript function slice(): var applicationPath &#8230; <a href="http://code.commongroove.com/2011/04/06/javascript-quickly-trim-the-last-character-from-a-string/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When developing web applications, you undoubtedly have wanted to remove the last character from a string (such as a URL or application path)  in your JavaScript code.</p>
<p>Here&#8217;s a quick way to get it done using the JavaScript function <strong>slice()</strong>:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> applicationPath <span style="color: #339933;">=</span> <span style="color: #3366CC;">'/my/application/path/'</span><span style="color: #339933;">;</span><br />
<span style="color: #003366; font-weight: bold;">var</span> removedLastCharacter <span style="color: #339933;">=</span> applicationPath.<span style="color: #660066;">slice</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://code.commongroove.com/2011/04/06/javascript-quickly-trim-the-last-character-from-a-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript, UTF-8 Encoding: escape() vs. encodeURIComponent()</title>
		<link>http://code.commongroove.com/2009/08/06/javascript-utf-8-encoding-escape-vs-encodeuricomponent/</link>
		<comments>http://code.commongroove.com/2009/08/06/javascript-utf-8-encoding-escape-vs-encodeuricomponent/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 23:07:00 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://code.commongroove.com/archive/2009/08/06/javascript-utf-8-encoding-escape-vs.-encodeuricomponent.aspx</guid>
		<description><![CDATA[ASP.Net web applications default to UTF-8 encoding.  Now, if you are using JavaScript to create or change URLs, you might run into an issue with the way the function &#8220;escape()&#8221; encodes characters if you are handling the decoding in your &#8230; <a href="http://code.commongroove.com/2009/08/06/javascript-utf-8-encoding-escape-vs-encodeuricomponent/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>ASP.Net web applications default to UTF-8 encoding.  Now, if you are using JavaScript to create or change URLs, you might run into an issue with the way the function &#8220;escape()&#8221; encodes characters if you are handling the decoding in your code behind via Request.QueryString.</p>
<p>To avoid ending up with &#8220;unkown&#8221; characters in your resultant string, use the JavaScript function &#8220;encodeURIComponent()&#8221; instead.  This should correctly encode your URLs for UTF-8.</p>
<p> </p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://code.commongroove.com/2009/08/06/javascript-utf-8-encoding-escape-vs-encodeuricomponent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sys.WebForms.PageRequestManagerServerErrorException in FireFox with MSFT Ajax</title>
		<link>http://code.commongroove.com/2008/12/11/sys-webforms-pagerequestmanagerservererrorexception-in-firefox-with-msft-ajax/</link>
		<comments>http://code.commongroove.com/2008/12/11/sys-webforms-pagerequestmanagerservererrorexception-in-firefox-with-msft-ajax/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 02:18:10 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[FireFox]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://code.commongroove.com/archive/2008/12/10/sys.webforms.pagerequestmanagerservererrorexception-in-firefox-with-msft-ajax.aspx</guid>
		<description><![CDATA[If you encounter this error while navigating away from an AJAX-enabled page with a non-IE browser, you can silence it with the following JavaScript: if &#40;!document.all&#41; //non-ie &#123; window.onbeforeunload = function&#40;&#41; &#123; Sys.WebForms.PageRequestManager.getInstance&#40;&#41;.add_endRequest&#40;ignoreOnEndRequest&#41;; &#125; &#125; function ignoreOnEndRequest&#40;sender, e&#41; &#123; err &#8230; <a href="http://code.commongroove.com/2008/12/11/sys-webforms-pagerequestmanagerservererrorexception-in-firefox-with-msft-ajax/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you encounter this error while navigating away from an AJAX-enabled page with a non-IE browser, you can silence it with the following JavaScript:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>document.<span style="color: #660066;">all</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">//non-ie</span><br />
<span style="color: #009900;">&#123;</span><br />
window.<span style="color: #660066;">onbeforeunload</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
Sys.<span style="color: #660066;">WebForms</span>.<span style="color: #660066;">PageRequestManager</span>.<span style="color: #660066;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">add_endRequest</span><span style="color: #009900;">&#40;</span>ignoreOnEndRequest<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #003366; font-weight: bold;">function</span> ignoreOnEndRequest<span style="color: #009900;">&#40;</span>sender<span style="color: #339933;">,</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
err <span style="color: #339933;">=</span> e.<span style="color: #660066;">get_error</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>err<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>err.<span style="color: #000066;">name</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;Sys.WebForms.PageRequestManagerServerErrorException&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
e.<span style="color: #660066;">set_errorHandled</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Hope it works for you!<br />
﻿</p>
]]></content:encoded>
			<wfw:commentRss>http://code.commongroove.com/2008/12/11/sys-webforms-pagerequestmanagerservererrorexception-in-firefox-with-msft-ajax/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using the PageRequestManager in ASP.Net AJAX (ATLAS)</title>
		<link>http://code.commongroove.com/2007/09/27/using-the-pagerequestmanager-in-asp-net-ajax-atlas/</link>
		<comments>http://code.commongroove.com/2007/09/27/using-the-pagerequestmanager-in-asp-net-ajax-atlas/#comments</comments>
		<pubDate>Thu, 27 Sep 2007 00:58:57 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Microsoft AJAX]]></category>

		<guid isPermaLink="false">http://code.commongroove.com/archive/2007/09/26/using-the-pagerequestmanager-in-asp.net-ajax-atlas.aspx</guid>
		<description><![CDATA[In your java script:: var postBackElem; Sys.WebForms.PageRequestManager.getInstance&#40;&#41;.add_beginRequest&#40;BeginRequestHandler&#41;; Sys.WebForms.PageRequestManager.getInstance&#40;&#41;.add_pageLoaded&#40;PageLoadedHandler&#41;; function BeginRequestHandler&#40;sender, args&#41; &#123; postBackElem = args.get_postBackElement&#40;&#41;; &#125; function PageLoadedHandler&#40;sender, args&#41; &#123; var c = 'panels created: '; var u = 'panels updated: '; for&#40;var i=0;i c += args.get_panelsCreated&#40;&#41;&#91;i&#93;.id + ', '; &#8230; <a href="http://code.commongroove.com/2007/09/27/using-the-pagerequestmanager-in-asp-net-ajax-atlas/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In your java script::</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">var</span> postBackElem<span style="color: #339933;">;</span><br />
Sys.<span style="color: #660066;">WebForms</span>.<span style="color: #660066;">PageRequestManager</span>.<span style="color: #660066;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">add_beginRequest</span><span style="color: #009900;">&#40;</span>BeginRequestHandler<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
Sys.<span style="color: #660066;">WebForms</span>.<span style="color: #660066;">PageRequestManager</span>.<span style="color: #660066;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">add_pageLoaded</span><span style="color: #009900;">&#40;</span>PageLoadedHandler<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #003366; font-weight: bold;">function</span> BeginRequestHandler<span style="color: #009900;">&#40;</span>sender<span style="color: #339933;">,</span> args<span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
postBackElem <span style="color: #339933;">=</span> args.<span style="color: #660066;">get_postBackElement</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #003366; font-weight: bold;">function</span> PageLoadedHandler<span style="color: #009900;">&#40;</span>sender<span style="color: #339933;">,</span> args<span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
<span style="color: #003366; font-weight: bold;">var</span> c <span style="color: #339933;">=</span> <span style="color: #3366CC;">'panels created: '</span><span style="color: #339933;">;</span><br />
<span style="color: #003366; font-weight: bold;">var</span> u <span style="color: #339933;">=</span> <span style="color: #3366CC;">'panels updated: '</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<br />
c <span style="color: #339933;">+=</span> args.<span style="color: #660066;">get_panelsCreated</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">id</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">', '</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<br />
u <span style="color: #339933;">+=</span> args.<span style="color: #660066;">get_panelsUpdated</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">id</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">', '</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>c<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>u<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://code.commongroove.com/2007/09/27/using-the-pagerequestmanager-in-asp-net-ajax-atlas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FireFox caches JavaScript state</title>
		<link>http://code.commongroove.com/2007/09/27/firefox-caches-javascript-state/</link>
		<comments>http://code.commongroove.com/2007/09/27/firefox-caches-javascript-state/#comments</comments>
		<pubDate>Thu, 27 Sep 2007 00:57:19 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[FireFox]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://code.commongroove.com/archive/2008/12/10/firefox-caches-javascript-state.aspx</guid>
		<description><![CDATA[Firefox uses in memory caching for JavaScript and can cause strange errors in your MSFT ASP.NET Ajax applications. Try adding this to your load event to prevent those errors: if &#40;Request.Browser.MSDomVersion.Major == 0&#41; // Non IE Browser?) &#123; Response.Cache.SetNoStore&#40;&#41;; // &#8230; <a href="http://code.commongroove.com/2007/09/27/firefox-caches-javascript-state/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Firefox uses in memory caching for JavaScript and can cause strange errors in your MSFT ASP.NET Ajax applications.</p>
<p>Try adding this to your load event to prevent those errors:</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:550px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>Request.<span style="color: #660066;">Browser</span>.<span style="color: #660066;">MSDomVersion</span>.<span style="color: #660066;">Major</span> <span style="color: #339933;">==</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">// Non IE Browser?)</span><br />
<span style="color: #009900;">&#123;</span><br />
Response.<span style="color: #660066;">Cache</span>.<span style="color: #660066;">SetNoStore</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// No client side cashing for non IE browsers</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>﻿</p>
]]></content:encoded>
			<wfw:commentRss>http://code.commongroove.com/2007/09/27/firefox-caches-javascript-state/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatically close a window in FireFox</title>
		<link>http://code.commongroove.com/2007/09/27/automatically-close-a-window-in-firefox/</link>
		<comments>http://code.commongroove.com/2007/09/27/automatically-close-a-window-in-firefox/#comments</comments>
		<pubDate>Thu, 27 Sep 2007 00:54:48 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://code.commongroove.com/archive/2007/09/26/automatically-close-a-window-in-firefox.aspx</guid>
		<description><![CDATA[You may run into an issue trying to close a created window in FireFox, this javascript usually does the trick on your close link: window.open(’java script:window.close();’,&#8217;_self’,&#8217;’);]]></description>
			<content:encoded><![CDATA[<p>You may run into an issue trying to close a created window in FireFox, this javascript usually does the trick on your close link:</p>
<p><span style="color: rgb(0, 0, 255); font-family: Courier New;">window.open(’java script:window.close();’,&#8217;_self’,&#8217;’);</span></p>
]]></content:encoded>
			<wfw:commentRss>http://code.commongroove.com/2007/09/27/automatically-close-a-window-in-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

