Home > Article > Web Front-end > The jquery statement written in the page is executed normally, but it cannot be executed when placed in the JS file_html/css_WEB-ITnose
RT,
The page is
<script>$("form#login").submit(function(){ ***********});</script>
$(function(){
$("form#login").submit(function(){
***
});
})
$(function(){$("form#login").submit(function(){ Your code here!});});
If it cannot be executed, please show the error reported by the browser first. I think it may be jquery and you. The js files are introduced in the wrong order
Brother, how can you run it if you don’t plan on it?
$(document).ready(function(){
//Put the function you want to run here
});