In Plunker, is there a setting to load the script.js file after the Document/Window is ready?
I can use the following if needs be, but a setting would be good.
Just don't want to add these at the top of all my plunks.
$(document).ready(function() {
//Amazing code goes here.....
}
window.onload=function(){
//adfsadf
}
I noticed there's only 178 Plunker tagged questions on SO, who would have tunk it:-)
Plunker doesn't do any manipulation of your markup to defer execution of scripts until after the document or window is ready. If you want your code to run after the document is ready, you have two options:
Keep your <script src="script.js">
tags in the <head>
element and use one of the approaches you describe to wait for the document ready event; or
Move your <script src="script.js">
to the bottom of the <body>
tag, right before </body>
.
Nothing in this is specific to Plunker. This is just how browsers work.