当我们编写内联javascript时,我们将代码保留在里面
$(document).ready(function(){
// Your code here
});
Run Code Online (Sandbox Code Playgroud)
如果我想粘贴
code // Your code here
Run Code Online (Sandbox Code Playgroud)
在外部.js文件然后我应该保持代码在这里
$(document).ready(function(){
// Your code here
});
Run Code Online (Sandbox Code Playgroud)
或者我们可以没有这个
// Your code here
Run Code Online (Sandbox Code Playgroud)