Javascript returns undefined only in IE?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
DaveTheAve
Forum Contributor
Posts: 385
Joined: Tue Oct 03, 2006 2:25 pm
Location: 127.0.0.1
Contact:

Javascript returns undefined only in IE?

Post 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?
User avatar
ghurtado
Forum Contributor
Posts: 334
Joined: Wed Jul 23, 2008 12:19 pm

Re: Javascript returns undefined only in IE?

Post 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) ?
Alan01252
Forum Newbie
Posts: 12
Joined: Sun Aug 03, 2008 3:20 pm

Re: Javascript returns undefined only in IE?

Post 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.
Post Reply