Why is this code not working anymore in jQuery 1.9.1?
Before updating to the latest jQuery release, I was using version 1.8.3 and the below code was working fine. With the newest version however, the function isn't working anymore. Why is this the case?
(By the way, if I include the migrate js, it is working with v. 1.9.1)
- <script type="text/javascript">
jQuery(document).ready(function($){
$(".imageShowcase img").hide();
$(".productImgDefault").show();
$("#attribute525").change(function() {
$(".imageShowcase img").hide();
var optionValue = $(this).attr('value');
var optionValueText = jQuery.trim($('#attribute525 :selected').text());
if( ! optionValue ){
$(".productImgDefault").show();
} else {
optionValueText = optionValueText.replace(/ /g,'_');
optionValueText = optionValueText.replace(/\u0027/g,'');
optionValueText = optionValueText.replace(/\u0026/g,'');
optionValueText = optionValueText.replace(/\u0028/g,'');
optionValueText = optionValueText.replace(/\u0029/g,'');
optionValueText = optionValueText.replace(/\u002B/g,'');
optionValueText = optionValueText.replace(/\u002F/g,'');
optionValueText = optionValueText.replace(/\u002C/g,'');
optionValueText = optionValueText.replace(/\u00D8/g,'');
optionValueText = optionValueText.replace(/\u00e0/g,"a");
optionValueText = optionValueText.replace(/\u00e1/g,"a");
optionValueText = optionValueText.replace(/\u00e2/g,"a");
optionValueText = optionValueText.replace(/\u00e4/g,"a");
optionValueText = optionValueText.replace(/\u00e7/g,"c");
optionValueText = optionValueText.replace(/\u00e8/g,"e");
optionValueText = optionValueText.replace(/\u00e9/g,"e");
optionValueText = optionValueText.replace(/\u00ea/g,"e");
optionValueText = optionValueText.replace(/\u00f6/g,"o");
optionValueText = optionValueText.replace(/\u00f9/g,"u");
optionValueText = optionValueText.replace(/\u00fa/g,"u");
optionValueText = optionValueText.replace(/\u00fb/g,"u");
optionValueText = optionValueText.replace(/\u00fc/g,"u");
optionValueText = optionValueText.replace(/\u00c0/g,"A");
optionValueText = optionValueText.replace(/\u00c1/g,"A");
optionValueText = optionValueText.replace(/\u00c2/g,"A");
optionValueText = optionValueText.replace(/\u00c4/g,"A");
optionValueText = optionValueText.replace(/\u00c7/g,"C");
optionValueText = optionValueText.replace(/\u00c8/g,"E");
optionValueText = optionValueText.replace(/\u00c9/g,"E");
optionValueText = optionValueText.replace(/\u00ca/g,"E");
optionValueText = optionValueText.replace(/\u00d6/g,"O");
optionValueText = optionValueText.replace(/\u00d9/g,"U");
optionValueText = optionValueText.replace(/\u00da/g,"U");
optionValueText = optionValueText.replace(/\u00db/g,"U");
optionValueText = optionValueText.replace(/\u00dc/g,"U");
optionValueText = optionValueText.replace(/\u00df/g,"ss");
$(".productImg" + optionValueText).show();
}
});
});
</script>
Thank you!