Home >Web Front-end >JS Tutorial >$(document).ready(function() {}) does not execute the initialization script_jquery

$(document).ready(function() {}) does not execute the initialization script_jquery

WBOY
WBOYOriginal
2016-05-16 16:43:551837browse

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...

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn