Неперехваченная ошибка типа: $(...).sidr не является функцией[Инструмент разработчика консольного Chrome] ⇐ Jquery
-
Anonymous
Неперехваченная ошибка типа: $(...).sidr не является функцией[Инструмент разработчика консольного Chrome]
I put this code into add basic module HTML block of a wordpress page builder. I encounter the white screen of death. Chrome developer console told me the following:
helpers.js?ver=4.5.3:15 Uncaught TypeError: $(...).sidr is not a function This can be traced from line 15 in helpers.js?ver=4.5.3:
$('#mobile-menu-trigger').sidr({ source: sourceVal, name: 'sidr-main' }); Before or after I restored the previous version of the page, there was no such error. The html code below seems to run normally if save as a html file and open it with chrome. Can someone please explain which might have possibly caused that error?
Edit: When I change the theme of wordpress, everything works again. With all of other themes, the code works so the problem should come from the theme.
$(document).ready(function() { getUpdates(); }); function getUpdates() { // get the data with a webservice call $.getJSON('http://api.thingspeak.com/channels/1360 ... ?callback=?', function(data) { // if the field1 has data update the page if (data.field1) { document.querySelector('.info-giver .temperature').innerHTML = data.field1.slice(0,4) + "°C"; document.querySelector(".info-giver .humidity").innerHTML = data.field2.slice(0,5) + "%"; document.querySelector('.info-giver .windspeed').innerHTML = data.field4.slice(0,4) +" m/s"; document.querySelector(".info-giver .pressure").innerHTML = data.field3 +"Pa" ; } }); } (jQuery); Temperature Humidity Windspeed Pressure N/a N/a N/a N/a
Источник: https://stackoverflow.com/questions/388 ... loper-tool
I put this code into add basic module HTML block of a wordpress page builder. I encounter the white screen of death. Chrome developer console told me the following:
helpers.js?ver=4.5.3:15 Uncaught TypeError: $(...).sidr is not a function This can be traced from line 15 in helpers.js?ver=4.5.3:
$('#mobile-menu-trigger').sidr({ source: sourceVal, name: 'sidr-main' }); Before or after I restored the previous version of the page, there was no such error. The html code below seems to run normally if save as a html file and open it with chrome. Can someone please explain which might have possibly caused that error?
Edit: When I change the theme of wordpress, everything works again. With all of other themes, the code works so the problem should come from the theme.
$(document).ready(function() { getUpdates(); }); function getUpdates() { // get the data with a webservice call $.getJSON('http://api.thingspeak.com/channels/1360 ... ?callback=?', function(data) { // if the field1 has data update the page if (data.field1) { document.querySelector('.info-giver .temperature').innerHTML = data.field1.slice(0,4) + "°C"; document.querySelector(".info-giver .humidity").innerHTML = data.field2.slice(0,5) + "%"; document.querySelector('.info-giver .windspeed').innerHTML = data.field4.slice(0,4) +" m/s"; document.querySelector(".info-giver .pressure").innerHTML = data.field3 +"Pa" ; } }); } (jQuery); Temperature Humidity Windspeed Pressure N/a N/a N/a N/a
Источник: https://stackoverflow.com/questions/388 ... loper-tool
Мобильная версия