Home > Article > Web Front-end > $(document).ready(function() {}) does not execute the initialization script_jquery
Today I found a page that never executes the initialization script. The code is as follows:
<script type="text/javascript" src="Script/jquery-1.11.1.min.js" /> <script type="text/javascript"> $(document).ready(function() { alert(1); }); </script>
Later I found out that the problem was just due to the closing method when referencing JQuery. I only needed to modify the closing method, as shown below:
<script type="text/javascript" src="Script/jquery-1.11.1.min.js" />
changed to
<script type="text/javascript" src="Script/jquery-1.11.1.min.js"></script>
Unknown reason...