Nik
Nik

Reputation: 7273

IE9 jQuery Ajax Not Working

I am using jQuery 1.6.1 and IE9. I am running the page on my machine trying to request data from a server. My Javascript looks like this:

var baseURL = "http://1.1.1.1/cgi-bin/ipcxml.cgi?";
var path = "scm:scm/data/system_names";
var fullURL = baseURL + path;
$.ajax (
    {
        url: fullURL,
        cache: true,
        context: $("#" + element),
        crossDomain: true,
        dataType: "xml",
        type: "GET",
        success: function (data) {
        alert (data);
        }
    }
);

When I run this code and I watch for the network traffic in the IE developer tools, I don't see the request go out. Does anybody have any thoughts?

Upvotes: 3

Views: 12217

Answers (2)

Faiyaz
Faiyaz

Reputation: 41

I was having problems with my tab, the content inside it was not updating like it did with other browsers. I scanned through the net and finally i found my solution:

cache:false

IE security causes the cache related problem so turning the cache to false solved my prob. Hope it helps

Upvotes: 4

Frédéric Hamidi
Frédéric Hamidi

Reputation: 262919

I don't know if it's the root cause of your problem, but colon (:) and slash (/) characters have to be encoded when used in query strings. Try:

var fullURL = baseURL + encodeURIComponent(path);

Upvotes: 1

Related Questions