Friday, March 18, 2011

Using jQuery with Other Libraries

I had a situation recently where I was using jQuery 1.5.1 and it was conflicting with another menu control library since both use "$" as a shortcut. I had no control over the menu control library, but fortunately there was a quick and easy way to work around the issue by overriding the $-function in jQuery.

<script type="text/javascript" language="javascript">
   var $j = jQuery.noConflict();

   function txtCity_onChange(CountyClientID) {
      $j("#" + CountyClientID).val("");
   }
</script>

http://docs.jquery.com/Using_jQuery_with_Other_Libraries

0 comments: