Looking for $(document).ready(function() { in the js code, but can't find it
回答済み
投稿日時:2021年5月19日
Hello! I'm trying to update the js code, and I'm supposed to add the new code after the following code, but can't find it:
$(document).ready(function() {
2
3
3件のコメント
Ifra Saqlain
Hey, you are adding the custom code in the incorrect bracket, now, you just need to copy this code and paste it into your script file:
and don't forget to add this jQuery Library at the document_head.hbs template:
If any issue let me know.
Thanks
Ifra
0
Jenean Witherspoon
Thank you for that :) So, we're on API v2 and I found the second code that you mentioned and added the below code:
$("label[for='request-attachments']").text("Upload current image");
I added it here:
document.addEventListener('DOMContentLoaded', function() {
// Key map
var ENTER = 13;
var ESCAPE = 27;
var SPACE = 32;
var UP = 38;
var DOWN = 40;
var TAB = 9;
function closest (element, selector) $("label[for='request-attachments']").text("Upload current image"); {
if (Element.prototype.closest) {
return element.closest(selector);
}
do {
if (Element.prototype.matches && element.matches(selector)
|| Element.prototype.msMatchesSelector && element.msMatchesSelector(selector)
|| Element.prototype.webkitMatchesSelector && element.webkitMatchesSelector(selector)) {
return element;
}
element = element.parentElement || element.parentNode;
} while (element !== null && element.nodeType === 1);
return null;
}
Whici I think is within the correct brackets. Trying to change the text on "Attachments", but it's not updating. Any idea what I could be doing wrong?
0
Ifra Saqlain
Hey, Which API version are you using? API v1 or API v2?
If you are using API v2; now you will have to add jQuery Lib (library) and add the new code with this function if you want to use jQuery:
because jQuery isn't being used in the API v2.
And
Find this function, you can update your JS code inside this function:
Thanks
Team
0
この投稿のコメント欄は閉じられています。