Answer the question
In order to leave comments, you need to log in
Installing code on wordpress?
Hello, I'm in a situation and don't know what to do.
Wrote a calculator for the site. Purely in php, html, js, css. Locally it works fine.
Now I'm trying to embed in wordpress on the page half does not work.
I use Jquery 1.9.1 in the code, version 1.12.4 is on the site . If I use the 1.12.4
library, then my code throws an error:
function incrementRoomValue() {
// Get current values
var value = parseInt(document.getElementById('iptCountRoom').value, 10);
var timeTotalApartmentMinute = parseInt(document.getElementById('iptTimeTotalApartmentMinute').value, 10);
var nextTotalApartmentMinute = timeTotalApartmentMinute + timeAddtRoomMinute;
// Check about max
if (value < maxRoomsCount && nextTotalApartmentMinute <= maxSliderMinute) {
// Increment
value = incrementValue(value, maxRoomsCount);
checkIncDecButtonRoom(value, minRoomsCount, maxRoomsCount);
document.getElementById('iptCountRoom').value = value;
// View
document.getElementById('divRoomsCount').innerHTML = value.toString()
+ ' ' + getEnding(value, endingStrings.aRoomEndings);
document.getElementById('spRoomsCount').innerHTML = value.toString() +
' ' + getEnding(value, endingStrings.aCalculateRoomEnding);
document.getElementById('aIncBathroom').className = 'plus-room';
// Calculation
calculationApartment(true, timeAddtRoomMinute);
checkTotalTime();
}
}
Uncaught ReferenceError: countRoom is not defined
at HTMLDocument.<anonymous>
at c
at Object.fireWith [as resolveWith]
at Function.ready
at HTMLDocument.H
Answer the question
In order to leave comments, you need to log in
Have you tried deregistering the standard jquery in the theme's functions.php and adding your own version?
Something like this...
function register_myscripts() {
wp_deregister_script('jquery');
wp_register_script('jquery', get_template_directory_uri() .
'/assets/js/jquery.js');
wp_enqueue_script('jquery');
}
add_action('wp_enqueue_scripts', 'register_myscripts');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question