Resolving conflicts on DWR with jQuery

July 4, 2009 at 4:41 pm (Uncategorized)

Since DWR’s util.js uses $ as an alias to ‘dwr.util.byId’ function, it may not have a smooth integration with jQuery as $ is also used by the latter as a function alias. In order to resolve this conflict, one could follow snippet:

<script type='text/javascript' src='/mycontext/js/jquery-1.3.2.min.js'></script>
<script type="text/javascript">
    var jq = jQuery.noConflict();
</script>
<script type='text/javascript' src='/mycontext/dwr/engine.js'></script>
<script type='text/javascript' src='/mycontext/dwr/util.js'></script>
<script type="text/javascript">
   jq(document).ready(function()
   {  //other function calls
   });
</script>

‘jq’ variable defined in place of $ to invoke the rest of other jQuery functions.

dwr/util.jsfor

2 Comments

  1. Jaylord said,

    tnx bro..u save me

  2. Intesar Shannan Mohammed said,

    Thanks worked perfectly

Post a Comment