开发者

IE9 jQuery Ajax Not Working

开发者 https://www.devze.com 2023-03-10 04:24 出处:网络
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:

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: tr开发者_如何学运维ue,
        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?


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


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);
0

精彩评论

暂无评论...
验证码 换一张
取 消