Всем здравствуйте. Выскакивает куча ошибок на сайте wordpress. Стоят: тема Cryptic версия: 2.7 и плагин Slider Revolution Версия 6.0.5. Версия jquery.js 1.12.4
Slider Revolution работает некорректно.
Таких 13 штук: в файле jquery.js:2:12681
Uncaught Error: Syntax error, unrecognized expression: .digit_container_ucfirst .digit_c_inner .digit_function() {
return this.substr(0, 1).toUpperCase() + this.substr(1);
}
at Function.ea.error (jquery.js?ver=1.12.4-wp:2)
at ea.tokenize (jquery.js?ver=1.12.4-wp:2)
at Function.ea (jquery.js?ver=1.12.4-wp:2)
at Function.a.find (jquery-migrate.min.js?ver=1.4.1:2)
at a.fn.init.find (jquery.js?ver=1.12.4-wp:2)
at a.fn.init.a.fn.find (jquery-migrate.min.js?ver=1.4.1:2)
at s ((index):3225)
at r ((index):3225)
at Object.success ((index):3225)
at i (jquery.js?ver=1.12.4-wp:2)
Таких 13 штук:
Error: Syntax error, unrecognized expression: .digit_container_ucfirst .digit_c_inner .digit_function() {
return this.substr(0, 1).toUpperCase() + this.substr(1);
} 4 jquery.js:2:12681
jQuery 6
error
tokenize
ea
find
find
find
s http://newage8f.beget.tech/:3237
r http://newage8f.beget.tech/:3237
i http://newage8f.beget.tech/:3237
rc_cryptoResize http://****.****.**/:3237
И такая одна:
hammer.min.js?ver=1.0.0:6 Uncaught TypeError: Cannot read property 'addEventListener' of null
at hammer.min.js?ver=1.0.0:6
at Array.forEach (<anonymous>)
at g (hammer.min.js?ver=1.0.0:6)
at m (hammer.min.js?ver=1.0.0:6)
at M.init (hammer.min.js?ver=1.0.0:6)
at M.x (hammer.min.js?ver=1.0.0:6)
at new M (hammer.min.js?ver=1.0.0:6)
at y (hammer.min.js?ver=1.0.0:6)
at new ia (hammer.min.js?ver=1.0.0:6)
at new ha (hammer.min.js?ver=1.0.0:6)
Можете ли подсказать мне что с этим делать? Как эти ошибки можно исправить?
Заранее спасибо.
UPD: А может быть проблема в шаблоне слайдера? Он использует js для отображения актуальной цены и изменения её в процентах за определённое время.
/*
SHORT DOCUMENTATION WITHIN THE SCRIPT
MORE TO FIND UNDER THE FAQ PAGE:
https://www.themepunch.com/faq/working-crypto-currency-template/
*/
// QUICK EDIT THE CURRENCYS AND CURRENCY SYMBOLS HERE
var fiat_1 = "RUB", fiat_1_symb = "₽",
fiat_2 = "USD", fiat_2_symb = "$";
revapi21.bind("revolution.slide.onloaded",function (e) {
// INITIALISE THE CRYPTO CALCULATOR ON THE DIFFERENT SLIDES
jQuery('.tp_cryptobtc').each(function() {jQuery(this).cryptoPunch({cur:'BTC', fiat:fiat_1, alternateFiat:fiat_2, fiatSymbol:fiat_1_symb, alternateFiatSymbol:fiat_2_symb});});
jQuery('.tp_cryptoeth').each(function() {jQuery(this).cryptoPunch({cur:'ETH', fiat:fiat_1, alternateFiat:fiat_2, fiatSymbol:fiat_1_symb, alternateFiatSymbol:fiat_2_symb});});
jQuery('.tp_cryptoltc').each(function() {jQuery(this).cryptoPunch({cur:'LTC', fiat:fiat_1, alternateFiat:fiat_2, fiatSymbol:fiat_1_symb, alternateFiatSymbol:fiat_2_symb});});
jQuery('.tp_cryptoxrp').each(function() {jQuery(this).cryptoPunch({cur:'XRP', fiat:fiat_1, alternateFiat:fiat_2, fiatSymbol:fiat_1_symb, alternateFiatSymbol:fiat_2_symb});});
jQuery('.tp_cryptomiota').each(function() {jQuery(this).cryptoPunch({cur:'IOT', fiat:fiat_1, alternateFiat:fiat_2, fiatSymbol:fiat_1_symb, alternateFiatSymbol:fiat_2_symb});});
jQuery('.tp_cryptodash').each(function() {jQuery(this).cryptoPunch({cur:'DASH', fiat:fiat_1, alternateFiat:fiat_2, fiatSymbol:fiat_1_symb, alternateFiatSymbol:fiat_2_symb});});
jQuery('.tp_cryptoneo').each(function() {jQuery(this).cryptoPunch({cur:'NEO', fiat:fiat_1, alternateFiat:fiat_2, fiatSymbol:fiat_1_symb, alternateFiatSymbol:fiat_2_symb});});
jQuery('.tp_cryptoxmr').each(function() {jQuery(this).cryptoPunch({cur:'XMR', fiat:fiat_1, alternateFiat:fiat_2, fiatSymbol:fiat_1_symb, alternateFiatSymbol:fiat_2_symb});});
jQuery('.tp_cryptoqtum').each(function() {jQuery(this).cryptoPunch({cur:'QTUM', fiat:fiat_1, alternateFiat:fiat_2, fiatSymbol:fiat_1_symb, alternateFiatSymbol:fiat_2_symb});});
// Initialise the Global Crypto Changer (*Options will be Described in coming Crypto Add On*)
jQuery('body').cryptoChange({fiat:fiat_1, alternateFiat:fiat_2});
/* Possible Options CRYPTOPUNCH (These are the Defaults - More Options in Upcoming AddOn):
cur:"BTC",
refresh:10000,
cur_selector:".tp_cur",
price_selector:".tp_price",
fiat:"RUB",
alternateFiat:"USD",
fiatSymbol:"₽$",
alternateFiatSybol:"$",
hour_selector:".tp_onehour",
day_selector:".tp_oneday",
green:"rgb(34, 185, 17)",
red:"rgb(234, 21, 25)",
timer:0,
digitNumbers:0,
lastValue:0,
lastFormattedValue:0
*/
/* Possible Options for CRYPTOCHANGE (These are the Defaults - More Options in Upcoming AddOn):
fiat:"RUB",
alternateFiat:"USD",
usd_selector:".set_usd",
eur_selector:".set_eur",
global:true
*/
});
// PLAY STOP UPDATES ON ELEMENTS WHICH ARE NOT VISIBLE
revapi21.bind("revolution.slide.onchange",function (e,data) {
jQuery('body').cryptoTogglePlay({within:"rs-slide", check:"active-rs-slide"});
});
revapi21.bind("revolution.slide.onbeforeswap",function (e,data) {
jQuery('body').cryptoUpdateInside({container:data.nextslide});
});
/**************************************************************************
* jquery.themepunch.Crypto Currency - jQuery Extension for Revolution Slider
* @version: 1.1 (17.01.2018)
* @requires jQuery v1.7 or later (tested on 1.9)
* @author ThemePunch
* ONLY USE WITH SLIDER REVOLUTION ! ALL RIGHTS RESERVED
**************************************************************************/
!function(t,e){"use strict";function a(e){t(e.to).each(function(){t(this).addClass("selected"),punchgs.TweenLite.to(this.parentNode,.5,{opacity:1})}),t(e.from).each(function(){t(this).removeClass("selected"),punchgs.TweenLite.to(this.parentNode,.5,{opacity:.5})});for(var a in e.ccs)e.ccs[a].data("options").fiat=e.val,e.ccs[a].update()}function i(a){if(clearTimeout(a.timer),!0!==a.resized){if(a.paused)return void(a.timer=setTimeout(function(){i(a)},a.refresh));a.fiat!==a.lastFiat&&(a.lastFormattedValue="-"),a.elements.cur.html(a.fiat===a.alternateFiat?a.alternateFiatSymbol:a.fiatSymbol),a.lastFiat=a.fiat,t.ajax({dataType:"json",url:"https://min-api.cryptocompare.com/data/price?fsym="+a.cur+"&tsyms="+a.fiat+","+a.alternateFiat,success:function(t){var e=r({type:"number",val:t[a.fiat],ref:a.ref,container:a.elements.price,lastFormattedValue:a.lastFormattedValue});a.lastFormattedValue=e.lastFormattedValue,a.lastValue=e.lastValue,n(a),a.timer=setTimeout(function(){i(a)},a.refresh)},error:function(t){a.lastFormattedValue=r({type:"number",val:"Not Available",ref:a.ref,container:a.elements.price,lastFormattedValue:a.lastFormattedValue}),n(a),a.timer=setTimeout(function(){i(a)},a.refresh)}})}else{if(a.lastValue!==e){var o=r({resized:a.resized,type:"number",val:a.lastValue,ref:a.ref,container:a.elements.price,lastFormattedValue:a.lastFormattedValue});a.lastFormattedValue=o.lastFormattedValue,a.lastValue=o.lastValue}a.resized=!1}}function n(a){a.hour_selector===e&&a.day_selector===e||t.ajax({dataType:"json",url:"https://min-api.cryptocompare.com/data/histohour?fsym="+a.cur+"&tsym="+a.fiat+"&limit=24&aggregate=1&e=CCCAGG",success:function(t){if(t.Data.length>0){var i=Math.abs(Math.round((t.Data[t.Data.length-1].close-a.lastValue)/a.lastValue*1e4)/100),n=Math.abs(Math.round((t.Data[0].close-a.lastValue)/a.lastValue*1e4)/100);if(a.hour_selector!==e){var r=a.c.find(a.hour_selector);t.Data[24].close<a.lastValue?(punchgs.TweenLite.set(r,{color:a.green}),r.html(i+"%")):(punchgs.TweenLite.set(r,{color:a.red}),r.html("-"+i+"%"))}if(a.day_selector!==e){var o=a.c.find(a.day_selector);t.Data[1].close<a.lastValue?(punchgs.TweenLite.set(o,{color:a.green}),o.html(n+"%")):(punchgs.TweenLite.set(o,{color:a.red}),o.html("-"+n+"%"))}}},error:function(t){if(a.hour_selector!==e){var i=a.c.find(a.hour_selector);punchgs.TweenLite.set(i,{color:a.red}),i.html("N.A")}if(a.day_selector!==e){var n=a.c.find(a.day_selector);punchgs.TweenLite.set(n,{color:a.red}),n.html("N.A")}}})}function r(t){switch(t.type){case"number":var e=o(t.val);(e.length!=t.lastFormattedValue.length||t.resized)&&c({val:e,container:t.container}),s({val:e,container:t.container}),t.lastValue=t.val}return{lastValue:t.val,lastFormattedValue:e}}function o(t){var e=Math.floor(t),a=""+Math.round(t%1*100),i=e+"";return a=a.length<2?a+"0":a,i=i.replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")+"."+a}function c(e){var a=parseInt(e.container.css("line-height"),0),i=t('<div class="digit_mask_container" style="line-height:'+a+'px; display:inline-block"></div>'),n=e.container.width()/e.val.length;for(var r in e.val){var o=t('<div class="rc_digital_container digit_container_'+r+'" style="width:'+Math.round(n)+'px;vertical-align:top;display:inline-block; position:relative; overflow:hidden; text-align:center; vertical-align:center;"></div>'),c=t('<div class="digit_c_inner" style="vertical-align:top;position:absolute;top:0px;left:0px;"></div>');if(","==e.val[r]||"."==e.val[r])c.append('<div class="digit_'+r+'" style="vertical-align:top;position:relative; width:auto">'+e.val[r]+"</div>"),o.width(n/1.2);else for(var s=0;s<10;s++)c.append('<div class="rc_single_digits digit_'+s+'" style="vertical-align:top;position:absolute; left:0px; top:'+s*a+"px;height:"+a+'px">'+s+"</div>");o.append(c),i.append(o)}e.container.html("").append(i)}function s(t){var e=parseInt(t.container.css("line-height"),0);punchgs.TweenLite.set(t.container.find(".rc_digital_container, .rc_single_digits"),{height:e});for(var a=0;a<10;a++)punchgs.TweenLite.set(t.container.find(".rc_single_digits.digit_"+a),{top:a*e});for(var i in t.val){var n=","==t.val[i]||"."==t.val[i],r=(n?t.container.find(".digit_container_"+i+" .digit_c_inner .digit_"+i):t.container.find(".digit_container_"+i+" .digit_c_inner .digit_"+t.val[i])).width(),o=t.container.find(".digit_container_"+i);punchgs.TweenLite.to(o,.5,{width:r}),n||punchgs.TweenLite.to(o.find(".digit_c_inner"),.5,{y:0-e*t.val[i]+"px"})}}t.fn.extend({cryptoPunch:function(a){var n={cur:"BTC",refresh:1e4,cur_selector:".tp_cur",price_selector:".tp_price",fiat:"RUB",alternateFiat:"USD",fiatSymbol:"₽",alternateFiatSymbol:"$",hour_selector:".tp_onehour",day_selector:".tp_oneday",green:"rgb(34, 185, 17)",red:"rgb(234, 21, 25)",timer:0,digitNumbers:0,lastValue:0,lastFormattedValue:0},a=t.extend(!0,{},n,a);return this.each(function(){window.cryptoIndex=window.cryptoIndex===e?0:window.cryptoIndex,a.ref="crypto_"+window.cryptoIndex,window.cryptoIndex++,a.c=t(this),a.c.addClass("active-crypto-container"),a.elements={price:a.c.find(a.price_selector),cur:a.c.find(a.cur_selector)},t(window).on("resize",function(){a.elements.price.html(a.lastFormattedValue),clearTimeout(a.rc_cryptoResize),clearTimeout(a.timer),a.rc_cryptoResize=setTimeout(function(){a.resized=!0,i(a)},100)}),i(a),a.c.data("options",a),window.cryptoList=window.cryptoList===e?new Array:window.cryptoList,window.cryptoList.push(a.c)})},pause:function(){t(this).data("options").paused=!0},play:function(){t(this).data("options").paused=!1},update:function(){i(t(this).data("options"))},cryptoChange:function(i){var n={fiat:"RUB",alternateFiat:"USD",usd_selector:".set_usd",eur_selector:".set_eur",global:!0},i=t.extend(!0,{},n,i);return this.each(function(){a({from:i.eur_selector,to:i.usd_selector,val:i.fiat}),(i.linkedTo===e||i.global)&&(i.ccs=window.cryptoList),t(document).on("click",i.usd_selector,function(){a({from:i.eur_selector,to:i.usd_selector,val:i.fiat,ccs:i.ccs})}),t(document).on("click",i.eur_selector,function(){a({from:i.usd_selector,to:i.eur_selector,val:i.alternateFiat,ccs:i.ccs})}),t(i.usd_selector+","+i.eur_selector).hover(function(){punchgs.TweenLite.to(this.parentNode,.5,{opacity:1})},function(){t(this).hasClass("selected")||punchgs.TweenLite.to(this.parentNode,.5,{opacity:.5})})})},cryptoUpdateInside:function(a){a.container.find(".active-crypto-container").each(function(){var a=t(this).data("options");a!==e&&(a.elements.price.html(a.lastFormattedValue),i(a))})},cryptoTogglePlay:function(e){return this.each(function(){for(var a in window.cryptoList)t(window.cryptoList[a]).closest(e.within).hasClass(e.check)?(window.cryptoList[a].play(),window.cryptoList[a].update()):window.cryptoList[a].pause()})}})}(jQuery);
В живую можно посмотреть здесь.
Нашла способ победить все эти ошибки. В строке
String.prototype.ucfirst = function() {
return this.substr(0, 1).toUpperCase() + this.substr(1);
};
string.prototype.ucfirst = function() {
return this.substr(0, 1).toUpperCase() + this.substr(1);
};
Ошибки ушли. Я понимаю что это костыль, но всё работает.
Айфон мало держит заряд, разбираемся с проблемой вместе с AppLab
при добавление в бд поста через ajax, отправляю этот пост в json формате, все приходит, но я не могу понять как в divcontainer_box показать его
Почему вычисляемое свойство,полученное из Промиса, выдает [object Promise] на самой странице, хотя в консоли 14 (как и должно быть):
Есть всплывающая форма, когда нажимаю на кнопку то форма не открывается, ранее убирал hidden, после форма отображалась корректно, но перестала...