3

Does anyone know why this isn't working in IE?

My code follows:

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'
        });
});
mkrisch
  • 105
  • 2
  • 12

3 Answers3

0

I was experiencing the same problem in IE9. It's possible that you have the default jQuery ajax cache setting on... (it's on by default).

Try setting the ajax setup's cache to false at the beginning of your page's javascript:

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

I was having this same problem yesterday and that solved it for me. Hope this helps.

For further reading, check this link out: http://www.peteonsoftware.com/index.php/2010/08/20/the-importance-of-jquery-ajaxsetup-cache/

Adam Levitt
  • 10,316
  • 26
  • 84
  • 145
  • THX guys! Everything except for Exact Target works like it should. I'll need to concentrate on that now to figure out the second part of this problem. – mkrisch May 29 '12 at 20:57
  • @mkrisch Don't accept answers unless they actually solve your problem. Ajax caching has nothing to do with the problem you posted, namely an undefined `handleResponse` reference. – Sampson May 29 '12 at 21:06
0

The SCRIPT5009: 'handleResponse' is undefined message is the result of not providing a callback function for the success event. You need to provide an executable method like below:

$.ajax({
    url: "http://api.dc1.exacttarget.com/integrate.aspx",
    data: { qf:'xml', xml:xmlDocument },
    dataType: "xml",
    success: function ( data ) {
        alert( data );
    }
});​
Sampson
  • 265,109
  • 74
  • 539
  • 565
  • Your coding has been very helpful, and I am eager to learn. In FF and Chrome the call was made and found my data in Exact Target but it didn't trigger the success call. I added an error request to the code and the error alert was triggered. Can you tell me what is happening? Also, I'm still having issues with this working in Explorer. Why is Explorer is blocking this? I don't mind doing the leg work, if you could put me on the correct path. thx! – mkrisch May 31 '12 at 14:37
  • @mkrisch Please update the question above to include the most recent code you're working with. Then take a moment to examine the network logs when this request is made. Press F12 to open the IE Developer Tools, then switch to the Network tab. Press "Start Recording", then have your page issue this ajax request, then press "Stop Recording" on the Network tab again. Can you see the request? Was it 404? Show us the results. Additionally, check your console output (in the F12 Developer Tools) for any messages following the ajax request. – Sampson May 31 '12 at 14:41
  • in developer tools the page loads and JQuery loads, but there wasn't anything recorded for the Ajax request. I placed the call in a click event to better control the request. I know that it's processing because I can get the error to trigger an alert. The alert box prints out [object Object] so could the problem be that my xml is being converted into an array that isn't processing in Explorer? – mkrisch May 31 '12 at 16:20
  • I believe I have this figured out. Explorer didn't like the xml data transfer. So I encoded the xml. Now I just have to add the success callback. THX for the help! – mkrisch May 31 '12 at 19:55
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'
        });
});
mkrisch
  • 105
  • 2
  • 12