First ajax sample, I need advice.

First ajax sample, I need advice.

Hi guys

This is my first ajax test sample.

Okay here is the codes of sample1.htm
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.   <style>
  5.   div { font-size:14px; }
  6.   </style>
  7.   <script src="http://code.jquery.com/jquery-1.5.js"></script>
  8. </head>
  9. <body>

  10.   <div ></div>
  11. <script>

  12. $.ajax({
  13.     type: "GET",
  14.     url: "test.js",
  15.     dataType: "script"
  16. });
  17. </script>

  18. </body>
  19. </html>
Below is the codes for test.js
  1. document.write("This is from external file, test.js")

I tried to run this but it did not show anything, the page is all white.
By the way I got the JQuery codes from this link,

Unfortunately the sample on the page is not 100% complete.
I just created the test.js on my own.

anyone would like to give advice.
Sorry this is my first time.


Thank you in advanced.