3

有谁知道为什么这在 IE 中不起作用?

我的代码如下:

var xmlDocument = encodeURI('https://api.dc1.exacttarget.com/integrate.aspx?qf=xml&xml=<?xml version="1.0" ?><exacttarget><authorization><username>EXCATTARGET-USER</username><password>EXCATTARGET-PASS</password></authorization><system><system_name>subscriber</system_name><action>add</action><search_type>listid</search_type><search_value>17571300</search_value><search_value2></search_value2><values><Email__Address>test21@email.com</Email__Address><status>active</status><Full__Name></Full__Name><ChannelMemberID></ChannelMemberID></values><update>true</update></system></exacttarget>');

$('.triggerAjax').click(function() {

    $.ajax({
          type: 'POST',
          url: xmlDocument,
          dataType: 'jsonp'
        });
});
4

3 回答 3

0

我在IE9中遇到了同样的问题。您可能有默认的 jQuery ajax 缓存设置...(默认情况下是打开的)。

尝试在页面 javascript 的开头将 ajax 设置的缓存设置为 false:

$(document).ready(function() {
    $.ajaxSetup({ cache: false });
    // your other initialization work goes here...
}

我昨天遇到了同样的问题,这为我解决了。希望这可以帮助。

如需进一步阅读,请查看此链接:http ://www.peteonsoftware.com/index.php/2010/08/20/the-importance-of-jquery-ajaxsetup-cache/

于 2012-05-29T20:07:47.763 回答
0

SCRIPT5009: 'handleResponse' is undefined消息是没有为事件提供回调函数的结果success。您需要提供一个可执行的方法,如下所示:

$.ajax({
    url: "http://api.dc1.exacttarget.com/integrate.aspx",
    data: { qf:'xml', xml:xmlDocument },
    dataType: "xml",
    success: function ( data ) {
        alert( data );
    }
});​
于 2012-05-29T21:04:16.857 回答
0
var xmlDocument = encodeURI('https://api.dc1.exacttarget.com/integrate.aspx?qf=xml&xml=<?xml version="1.0" ?><exacttarget><authorization><username>EXCATTARGET-USER</username><password>EXCATTARGET-PASS</password></authorization><system><system_name>subscriber</system_name><action>add</action><search_type>listid</search_type><search_value>17571300</search_value><search_value2></search_value2><values><Email__Address>test21@email.com</Email__Address><status>active</status><Full__Name></Full__Name><ChannelMemberID></ChannelMemberID></values><update>true</update></system></exacttarget>');

$('.triggerAjax').click(function() {

    $.ajax({
          type: 'POST',
          url: xmlDocument,
          dataType: 'jsonp'
        });
});
于 2012-05-31T20:59:32.463 回答