Last active
November 30, 2018 10:54
-
-
Save rachidbch/e0317205918fd95e9b7d72aea52a8906 to your computer and use it in GitHub Desktop.
TEST: Loading JQuery with defer attribute
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.test = "Fail Init"; | |
// test result when jQuery ready fires | |
$(function() { $('#resultJQ').html("jQuery result: " + window.test);}); | |
// test result when document is ready | |
document.addEventListener("DOMContentLoaded", function() { $('#resultDOM').html("DOM result: " + window.test);}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.test = "fail 1"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.test = "pass"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment