I have a drop down list. On the change event of the drop down list I have written some javascript code. When I select an option from the drop down list a site opens in the new window.
So for this I wrote some javascript code on the change event of the drop down list.
But the problem is that when I enable the optimize js files then my drop down change event does not work and when I disable the optimize js files then the change event of the drop down works.
So what should I do for this to work in both condition?
UPDATED:
Drupal.behaviors.change = function (context) {
$(".test").change(function(){
var page = $(".test").val();
window.open(''+page+'', '_blank');
}) ;
};
Ctrl + Shift + Jand post the errors ? If its an error like $ is not defined then its because Jquery Library is loaded after your scripts are loaded as said by ninjascorner