Home > Web Front-end > JS Tutorial > body text

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

WBOY
Release: 2016-05-16 16:43:55
Original
1822 people have browsed it

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>
Copy after login

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" />
Copy after login

changed to

<script type="text/javascript" src="Script/jquery-1.11.1.min.js"></script>
Copy after login

Unknown reason...

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template