The jquery-migrate plugins triggers a warning whenever a deprecated function is called. As such, it's necessary to test all functions on the page: simply loading the page won't show all the errors.
I whipped up a simple example that shows this:
// should be $('#test').on('click', ...
$('#test').click(function() {
$('#test2').focus(); // should be $('#test').trigger('focus')
})
$('#test2').on('focus', function() {
$(this).val('from js');
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-migrate/3.1.0/jquery-migrate.js"></script>
<button id="test">Initial</button>
<input id="test2" />
If you run the snippet, you'll see an error when the page loads, warning that you can't use the click
shorthand (you need to use .on()
).
If you then click on the button, you'll see a new warning, saying that you can't use the focus
shorthand (you need to user .trigger()
).
As you can see, the second error doesn't show up when the page loads, so you need to test all your functions.