<jquery 胡亂寫1> Hello world

1. jQuery Beginner tutorial: How to create Hello World example

2. hello world 寫法一

https://jquery.com/download/下載

Download the compressed, production jQuery 2.2.0

下載官網 jquery-2.2.0.min.js 與 hello.html 放在同一個資料夾中

hello.html 內容如下:

— — — — — — — — — — — — — — — — — — — — — —

<html>
 <head>
 <title>jQuery Hello World 
 </title>
 <script type=”text/javascript” src=”jquery-2.2.0.min.js”></script> 
 </head>
 
 <body>
 <script type=”text/javascript”>
 $(document).ready(function(){ 
 $(“#msgid”).html(“2. This is Hello World by JQuery”);});
 </script>
 
 1. This is Hello World by HTML 
 <div id=”msgid”> 
 </div>
 
 <script type=”text/javascript”> alert(“3. Hello world!”);</script> 
 </body>
</html>

---------------------------

下載點:

https://drive.google.com/file/d/0B1Rs6BoH_52Ud1FVWXc0ZlZnSWM/view?usp=sharing

3. hello world 寫法二,調用google:

https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js

hello.html 內容如下:

— — — — — — — — — — — — — — — — — — — — —

<html>
 <head>
 <title>jQuery Hello World 
 </title>
 <script type=”text/javascript” src=”https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"> </script>
 </head>
 
 <body>
 <script type=”text/javascript”>
 $(document).ready(function(){ 
 $(“#msgid”).html(“2. This is Hello World by JQuery”);});
 </script>
 
 1. This is Hello World by HTML 
 <div id=”msgid”> 
 </div>
 
 <script type=”text/javascript”> alert(“3. Hello world!”);</script> 
 </body>
</html>

— — — — — — — — — — — — — — — — — — -

下載點:

https://drive.google.com/file/d/0B1Rs6BoH_52UdzRaT1dLX2RDbDA/view?usp=sharing