Have a set of prototype-enabled ajax code that is working in all browsers other than IE. In IE8 the JSON, that otherwise gets returned to the onSuccess handler function specified in Ajax.Request, gets thrown into a file download stream which pops up and prompts for where to download.
askForm = $('askForm');
var askUrl = '.';
var askParameters = askForm.serialize(true);
askForm.disable();
var askAjax = new Ajax.Request(
askUrl, {
method: 'post',
parameters: askParameters,
onSuccess: handleResults,
onFailure: handleError
}
);
function handleError(transport) {
alert('Please refresh this page, an error occurred in processing at the server.');
}
function handleResults(transport) {
...
}
There is more code in the handleResults function but this never gets called. Having debugged, the download prompt occurs when the Ajax.Request function is called.
The filename IE8 prompts to download changes each time, 4 seemingly random hex values (8 characters) with no filename extension. And the contents of the file are the pure JSON response from the server...
{"question": ["Enter your question*"], "name": ["Enter your name (First L.)*"], "sender": ["Enter your e-mail*"]}
Would be much obliged for any tips here. This is occurring on Snow Leopard with IE8 running in VMWare Fusion accessing a site running via apache/django/python on OS X. However, since Chrome and Firefox in the VMWare Windows XP machine function properly, seems to point directly to IE8 as the culprit.