Archive

Archive for July 4th, 2009

Resolving conflicts on DWR with jQuery

July 4th, 2009 Shrihari 1 comment

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
Categories: Uncategorized Tags: