You should add timeout functionality to make sure that your snippet will execute its content after the page/component loads
For example:
setTimeout(
function(){
// ADD YOUR CODE HERE
},
1000);
This code will execute after a second, this will give the page some time to load before your script works.
Try these, one of them should do the trick:
$(function() {
console.log( "ready!" );
});
or
$( document ).ready(function() {
console.log( "ready!" );
});
Hi,
Kindly check the Mendix Console and Browser console, if there are any errors for the JQuery which has been added to the JS Snippet