I have a js file which has several fn() and it was working fine but when at tached a js plugin file, i get error in firebug.
$(document).ready(function() {
var innerHTML = $("#id_1").html();
$("#Id_2").html(innerHTML)
});
above fn() was working but now i am getting error in firebug $("#id_1") is null.
if i use jQuery instead of $ then it’s workin fine. please see below the corrected function.
$(document).ready(function() {
var innerHTML = jQuery("#id_1").html();
jQuery("#Id_2").html(innerHTML)
});
now my problem is, i have several js files and i have used $ and now i might have to change $ to jQuery. please give me any idea to avoid this.
The extra library you are using (wysiwyg.js) is also declaring a function
$():You should use jQuery.noConflict()