简体   繁体   中英

Basic JavaScript alert not showing

I've got an aspx masterpage and want to include Google's jQuery script. However, to test it's working, I've got the below code in the head of my masterpage. However, none of the content pages display the alert. What am I missing?

 <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" />

 <script type="text/javascript">
   $(document).ready(function() {                
     alert("Test Alert");                
   });
 </script>

<script> tags are not self-closing.

Replace

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" />

with

 <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM