My jQuery code is not working and in Firebug console it says: “jQuery is not defined”. I have checked jQuery is loading but I still not getting why its showing error.
My jQuery code looks like:
( function($) {
$(document).ready(function() {
$("form#add #divOptionsBlock .item img").css("visibility","hidden");
$('#divOptionsBlock .txtBoxStyle:first').change(function() {
var fpath = $("#divOptionsBlock .item img").attr("src") ;
var finalimage = 'http://shop.daactive.com/thumbnail.asp?file='+fpath+'&maxx=300&maxy=0';
var fpath2 = $("form#add img#large").attr("src",finalimage);
var imagepath_ahref="http://shop.daactive.com/"+fpath;
var fpath3 = $("form#add a#listing_main_image_link").attr("href",imagepath_ahref);
var fpath4 = $("form#add a#listing_main_image_link .MagicBoxShadow img").attr("src",imagepath_ahref);
var textvalue = $('#divOptionsBlock .txtBoxStyle:first option:selected').text()
$("#imagecaptiont").html(textvalue);
});
});
} ) ( jQuery );
You did not include jQuery! Add this to your
<head>or before the end of<body>: