Page 1 of 1
Javascript returns undefined only in IE?
Posted: Tue Jul 29, 2008 9:42 pm
by DaveTheAve
Code: Select all
$.ajaxFileUpload (
{
url:RE.Server.ajaxBaseURL+'upload/'+id+'/'+type,
secureuri:false,
fileElementId:'file'+id,
dataType: 'json',
/*success: uiCallback,*/
success: function (data, status, e) {
alert(data.id);
},
error: function (data, status, e) {
alert(e);
}
}
);
The alert(data.id); in firefox and other browsers report data.id as being 172; however, when i it in IE it's reported as undefined. Can anyone help me?
Re: Javascript returns undefined only in IE?
Posted: Thu Jul 31, 2008 1:14 pm
by ghurtado
There are too many pieces going on here to be able to pinpoint the problem from a single chunk of javascript. You have a javascript library, using AJAX and JSON in the response, so the IE bug could be anywhere in the pipeline.
Lets start at the finish. What happens if you try to alert(data) ?
Re: Javascript returns undefined only in IE?
Posted: Sun Aug 03, 2008 3:59 pm
by Alan01252
Where is data defined.
Also be careful ie REQUIRES that your variables have var infront of them when first defined.
e.g
var bob = 1; // No errors in ie /firefox
==========
bob = 1; // No errors in firefox, but errors in ie.