jQuery Ajax无法在IE 8/9中运行

时间:2014-01-16 18:29:36

标签: ajax jquery internet-explorer-8 internet-explorer-9

我正在使用一个解决方案,我正在使用Modernizr,Ruery和把手 - 在Opera,Safari,FireFox,Chrome和IE10中一切顺利,但在IE8 / IE9中似乎jQuery.ajax不起作用。如果我用.get替换.ajax似乎一切顺利,但是我不会像asynx,contentType和crossDomain一样运行相同的参数。

jq.ajax({
    url: "http://localhost:61113/tmp/jtemp.html",
    contentType: "application/x-www-form-urlencoded; charset=UTF-8",
    dataType: "html",
    crossDomain : true,
    success: function (data) {

        jq("body").append(data);

        var source = jq("#some-template").html();
        var template = Handlebars.compile(source);

        var data = {
            users: [{
                person: {
                    firstName: "Garry",
                    lastName: "Finch"
                },
                jobTitle: "Front End Technical Lead",
                twitter: "gazraa"
            }, {
                person: {
                    firstName: "Garry",
                    lastName: "Finch"
                },
                jobTitle: "Photographer",
                twitter: "photobasics"
            }, {
                person: {
                    firstName: "Garry",
                    lastName: "Finch"
                },
                jobTitle: "LEGO Geek",
                twitter: "minifigures"
            }]
        };

        Handlebars.registerHelper('fullName', function (person) {
            return person.firstName + " " + person.lastName;
        });

        jq('body').append(template(data));

    }
});

对于冲突问题,我已将jQuery重命名为jq。

0 个答案:

没有答案
相关问题