Search Options
close
Search the following clips:
All Clips
Everyone's Clips
My Guides
Sign Up
Install
Learn More
Login
Avoid this tricky conflict between ASP.NET AJAX and jQuery
travislaborde
follow
0
9-30-2008 7:09 AM
761 views
tags:
programming
,
asp.net
,
jquery
Add a Comment
Login
to Comment. Not a member yet?
Sign up
Today's Top Clips
The Scandal of Hunger in America
Fire Rainbow
Public Execution in Iran [12 images]
Siberian Tigers Drawing Near Extinction
Walking Into Earth's Heart
Rush Limbaugh Calls for Military Coup
10 of the World's Greatest Jobs
Laugh!
Surprised Kitty
Winter Bird Feeding
visit the
Top Clips page
View the Top Clips from
September 30, 2008
Embed This Clip In Your Site...
<div style="margin: 12px 0px; font-family: arial; color: #333333; background: #ffffff; border: solid 4px #e5e5e5; width: 100%; clear: left;"><div class="CM_CTB_Content_Wrap" style="margin: 0px; padding: 0px;background-color: #ffffff;"><div style="border-bottom: solid 1px #dcdcdc; white-space: nowrap; margin-bottom: 8px; background-color: #eeeeee ;background-image: url(http://www.clipmarks.com/images/source-bg.gif); background-repeat: repeat-x; height: 24px; line-height: 24px; vertical-align: middle; padding-bottom: 4px; color: #666666; font-size: 10px;" ><a href="http://clipmarks.com/clip-to-blog/" title="see clips that are hot right now"><img src="http://content.clipmarks.com/blog_embed/c654cd67-b226-4800-b45d-182e831cf025/99236B46-5B9C-4D8C-BC5B-29E271BD09EA/" alt="" width="19" height="19" border="0" style="vertical-align: middle; margin: 0px 4px; display: inline; border: none; float:none;" /></a>clipped from <a title="http://encosia.com/2008/09/28/avoid-this-tricky-conflict-between-aspnet-ajax-and-jquery/" href="http://encosia.com/2008/09/28/avoid-this-tricky-conflict-between-aspnet-ajax-and-jquery/" style="font-size: 11px;">encosia.com</a></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://encosia.com/2008/09/28/avoid-this-tricky-conflict-between-aspnet-ajax-and-jquery/"><H2><A title="Permanent Link: Avoid this tricky conflict between ASP.NET AJAX and jQuery" rel="bookmark" href="http://encosia.com/2008/09/28/avoid-this-tricky-conflict-between-aspnet-ajax-and-jquery/">Avoid this tricky conflict between ASP.NET AJAX and jQuery</A></H2></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://encosia.com/2008/09/28/avoid-this-tricky-conflict-between-aspnet-ajax-and-jquery/"><P>Last month, I came across <A target="_blank" rel="nofollow" href="http://forums.asp.net/t/1313299.aspx">someone having an odd problem with ASP.NET AJAX and jQuery, on the ASP.NET forums</A>. While using the jDrawer plugin to jQuery, he found that adding an ASP.NET AJAX ScriptManager <A target="_blank" rel="nofollow" href="http://plugins.jquery.com/node/3842">completely broke jDrawer</A>.</P></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://encosia.com/2008/09/28/avoid-this-tricky-conflict-between-aspnet-ajax-and-jquery/"><div align="center"><img src="http://content9.clipmarks.com/blog_cache/encosia.com/img/F27D4DD1-77A6-4480-8F59-043057839259" alt="A JavaScript error when using jDrawer with ASP.NET AJAX: arguments[i] is undefined" /></div></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://encosia.com/2008/09/28/avoid-this-tricky-conflict-between-aspnet-ajax-and-jquery/"><P>As I’ve previously covered, one of the nice things that ASP.NET AJAX brings to the table is <A href="http://encosia.com/2007/12/04/work-smarter-ms-ajaxs-javascript-base-type-extensions/">an assortment of upgrades to JavaScript’s base types</A>. Unfortunately one of ASP.NET AJAX’s modifications has subtly modified this arguments property:</P></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://encosia.com/2008/09/28/avoid-this-tricky-conflict-between-aspnet-ajax-and-jquery/"><div align="center"><img src="http://content6.clipmarks.com/blog_cache/encosia.com/img/1824C5E1-3799-4739-9371-44CB739C2678" alt="Using Firebug to debug the jDrawer JavaScript error" /></div></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://encosia.com/2008/09/28/avoid-this-tricky-conflict-between-aspnet-ajax-and-jquery/"><P>The solution is to iterate over the arguments array using a traditional for loop:</P></blockquote><div style="height: 2px; font-size: 2px; background: #dcdcdc; border-bottom: solid 1px #f5f5f5; margin: 2px 4px;"></div><blockquote style="text-align: left; padding: 0px 8px; margin: 4px 0px 8px 0px; background: transparent; border: none;" cite="http://encosia.com/2008/09/28/avoid-this-tricky-conflict-between-aspnet-ajax-and-jquery/"><PRE class="javascript">PreloadImages: <SPAN>function</SPAN><SPAN>(</SPAN><SPAN>)</SPAN> <SPAN>{</SPAN> <SPAN>for</SPAN><SPAN>(</SPAN><SPAN>var</SPAN> i = <SPAN>0</SPAN>; i++; i < arguments.<SPAN>length</SPAN><SPAN>)</SPAN> <SPAN>if</SPAN> <SPAN>(</SPAN>arguments<SPAN>[</SPAN>i<SPAN>]</SPAN>.<SPAN>type</SPAN> === <SPAN>"array"</SPAN><SPAN>)</SPAN> <SPAN>for</SPAN> <SPAN>(</SPAN><SPAN>var</SPAN> j <SPAN>in</SPAN> arguments<SPAN>[</SPAN>i<SPAN>]</SPAN><SPAN>)</SPAN> <SPAN>// Irrelevant image preloading code.</SPAN> <SPAN>else</SPAN> <SPAN>// Irrelevant image preloading code.</SPAN> <SPAN>}</SPAN>,</PRE></blockquote></div><div style="margin: 0px 6px 6px 4px;"><table style="font-size: 11px;border-spacing: 0px;padding: 0px;" cellpadding="0" cellspacing="0" width="100%"><tr><td style="background:transparent;border-width:0px;padding:0px;"> </td><td align="right" style="background:transparent;border-width:0px;padding:0px;width:107px" width="107"><a href="http://clipmarks.com/share/99236B46-5B9C-4D8C-BC5B-29E271BD09EA/blog/" title="blog or email this clip"><img src="http://content8.clipmarks.com/images/c2b-foot.png" border="0" alt="blog it" width="107" height="17" style="border-width:0px;padding:0px;margin:0px;" /></a></td></tr></table></div></div>
New from the makers of Clipmarks:
Amplify.com - Don't just share the news...Amplify it!
Clipmarks
Home
New Clips
Top Clips
Dashboard
Popular Topics
News
Life
Science
Technology
Entertainment
Get Started
Sign Up
Install Clipping Tool
How Clipping Works
Clip-to-Blog™
ClipSearch
Tools and Resources
FAQ
ClipWeek
Top Clippers
Top Tags
Site Map
About Clipmarks
About Us
Contact
Copyright
Privacy
EULA
OK