0
我正在運行一個A/B測試,並且已經寫了一些jQuery,它在預覽面板中工作 - 但是當我將它按住時 - 我沒有看到的變化,我看到了一個錯誤:
TypeError: $.initElementData is not a function
...his,c);return}}c.unshift("Generic Events");this.genericHandler.apply(this,c)}})
jquery.... > eval (line 1, col 9180) TypeError: $.ui is undefined
$.extend($.ui.autocomplete.prototype, {
我試着用搜索引擎這一點 - 它似乎說話老版本的jQuery的 - 但我使用了最新的?
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
請參閱下面我的代碼:
</head>
<script>
jQuery.fn.extend({
live: function (event, callback) {
if (this.selector) {
jQuery(document).on(event, this.selector, callback);
}
}
});
//Online Only
//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 Only
//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>