I want to use jQuery in the sidebar of my Firefox extension. This is how I enable jQuery in sidebar.xul
<script type="application/x-javascript" src="chrome://myaddon/content/
scripts/jquery/js/jquery-1.4.4.min.js"/>
<script type="text/javascript">jQuery.noConflict();</script>
The first question is why do we use a function jQuery.noConflict()?
I tried to solve some other issues, but it did not work for me.
However, this does not work for me on FF 3.6.13:
<script type="application/x-javascript"
src="chrome://myextension/content/scripts/jquery/js/jquery-1.4.4.min.js"/>
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function () {
alert("hello");
});
</script>
source
share