javascript - jquery/2.2.0 - TypeError: $.initElementData is not a function -
i'm running a/b test , have written jquery works in preview panel - when push live - don't see changes , i'm seeing error:
typeerror: $.initelementdata not function
...his,c);return}}c.unshift("generic events");this.generichandler.apply(this,c)}})
jquery.... > eval (line 1, col 9180) typeerror: $.ui undefined
$.extend($.ui.autocomplete.prototype, {
i've tried googling - , appears speak old version of jquery - i'm using latest?
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
please see code below:
</head> <script> jquery.fn.extend({ live: function (event, callback) { if (this.selector) { jquery(document).on(event, this.selector, callback); } } }); //online //available online not available in stores $('div.result-sold').each(function() { if($(this).find('li:contains("available online")').length>0 && $(this).find('li:contains("available online")').next('li:contains("not available in stores")').length>0){ $(this).find('li:contains(not available in stores)').remove(); $(this).find('li:contains("available online")').text('online only'); } }); //in stores //not available online available in stores $('div.result-sold').each(function() { if($(this).find('li:contains("not available online")').length>0 && $(this).find('li:contains("not available online")').next('li:contains("available in stores")').length>0){ $(this).find('li:contains(not available online)').remove(); $(this).find('li:contains("available in stores")').text('in stores only'); } }); /* temp sold out online :: not available in stores */ $('div.result-sold').each(function() { if($(this).find('li:contains("temporarily sold out online")').length>0 || $(this).find('li:contains("temporarily sold out online")').next().text()==="available in stores") { $(this).find('li:contains("available in stores")').remove(); $(this).find('li:contains("not available in stores")').remove(); } }); /* sold out online :: available in stores */ $('div.result-sold').each(function() { if($(this).find('li:contains("sold out online")').length>0 || $(this).find('li:contains("sold out online")').next().text()==="available in stores"){ $(this).find('li:contains("available in stores")').remove(); } }); </script>
where script tag located in page? i'm assuming it's in head right? if is, load jquery in it's entirety before executing code. seems if jquery not loaded before code executed. if move script before body tag, same result?
Comments
Post a Comment