Sigh. I feel like a chimp. (basic jquery get question)

Sigh. I feel like a chimp. (basic jquery get question)

OK, so I'm hacking on a bit of jquery I found on the internet, and I've actually figured some stuff out.  I can get jquery to change variables and then send them to the server on the fly, which is cool, and I think I'm starting to figure it all out.

So in this case, I'm trying to figure out how to set some variables dynamically at load time.  I figured I'd store them in a plaintext file, while I'm learning, and I'd pull them in at load time using .get.  Seems simple enough.

Well, turns out I must not have the faintest clue of how .get works, because I've reduced the issue to the smallest test case I can, and I still can't get it to work.

Here's the code of my test page, in its entirety:

  1. <html>
  2.     <head>
  3.         <title>Minimal Debug Case</title>
  4.         <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
  5.     </head>
  6.     <body>
  7.         <h1>Jquery test!</h1>
  8.         <script type="text/javascript" charset="utf-8">
  9.             alert("foo");
  10.             $.get("http://myserver.org/foo.html", function(data){
  11.                 alert("Data Loaded: " + data);
  12.             });
  13.         </script>
  14.     </body>
  15. </html>
This $.get call is an example cut and pasted from the jquery.get api page.  The alert("foo") call is just to make sure that Javascript is even working.

"foo.html" is just plain html.  It loads in the browser and says "foo".

Case #1: when I run this by having it on my local machine, I get the "foo" alert, and then I get the alert "Data Loaded:" with no data.  Which says to me "there was a successful get made, because otherwise it wouldn't even have returned the alert, because the success callback wouldn't have happened."

Case #2: when I upload this page to the web server and fetch it from the remote URL, I get the "foo" alert, but then I get no "Data Loaded" alert at all -- which I'm supposing means that the "get" was no longer successful, thus the success callback doesn't even run, and I get nothing.

It's clear that I'm missing something completely fundamental, but for the life of me, I can't figure out what.  Give a n00b a clue?  This is the simplest case I can come up with, and I have no idea why it doesn't work -- and not only does it not work, but it fails to work in two different ways, depending on where the page lives.

HALP!

--g