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:
-
var data = []; // To be defined in data.js
-
- $(document).ready(function() {
- $('#button').click(function() {
- // This should load the file specified in the text box, but I'm just trying to get
-
// something to work at this point
-
$.getScript('data.js', function() { alert('done!'); });
-
-
//...
- });
- });
- ...
- <input type="text" size="30" value="data.js" /><button type="button" id="button">Load Data</button>
Thanks in advance for any help!
- John