AJAX Calls Not Working on Local Computer

AJAX Calls Not Working on Local Computer

Hi all,

I'm trying to load a Javascript file which contains an array of data using .getScript().  It works fine on my server, but the request is never being made when I run it on my own computer, though the callback function is called.  Is this an inherent limitation in JQuery/AJAX, or am I doing something stupid?

Here is the relevant code:

  1. var data = []; // To be defined in data.js
  2. $(document).ready(function() {
  3. $('#button').click(function() {
  4. // This should load the file specified in the text box, but I'm just trying to get
  5. // something to work at this point
  6. $.getScript('data.js', function() { alert('done!'); });
  7. //...
  8. });
  9. });

  10. ...

  11. <input type="text" size="30" value="data.js" /><button type="button" id="button">Load Data</button>

Thanks in advance for any help!

- John