JQuery Function is not defined in scripts file -
apparently jquery function not defined. have no idea why. calling jquery before scripts file thats not case , jquery working fine before put in function.
(function ($) { function selectcharacter(){ $('select.character_select').change(function(){ alert('select field value has changed to' + $('select.character_select').val()); }); } })(jquery); selectcharacter();
this scope issue. function creates new scope. so, you're trying invoke private variable function outside of function. can fix changing invoke function:
(function ($) { function selectcharacter() { $('select.character_select').change(function() { alert('select field value has changed to' + $('select.character_select').val()); }); } selectcharacter(); })(jquery);
Comments
Post a Comment