Jquery not working on Kentico

Kyle Tran asked on February 18, 2022 02:32

Hi All,

Question regarding adding some Jquery into the master page. I have a script that will check for the URL if it's http, then change it to https for Youtube videos. So this code works great on basic html, however as I add the Jquery into the master page and add an alert the items does not update the http to https. Does Kentico 7 not support Jquery? Here's the simple sytnax below.

Recent Answers


Kyle Tran answered on February 18, 2022 02:45 (last edited on February 18, 2022 02:45)

$( document ).ready(function() {

     $("param").each(function(i) {        

        alert("Hello");
        $(this).attr("value", $(this).attr("value").replace("http://", "https://"));    
});

  $("iframe").each(function(i) {    

   alert(i);


        $(this).attr("src", $(this).attr("src").replace("http://", "https://"));    
}); 

});

0 votesVote for this answer Mark as a Correct answer

kentico guy answered on February 21, 2022 19:12

Did you add the jquery script source (jquery.x.x.x.js) to your page?

0 votesVote for this answer Mark as a Correct answer

Kyle Tran answered on February 23, 2022 18:53

Yes, I did it's on the global master page but the page did not register with the function. Basically put an alert in there and it didn't even come up.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.