This was helpful in determining that the problem is not in what is
coming back from the server, but rather what is sent to it. The full
jquery code for this page is below.

What is to happen is that an input box in my form called ajax is
supposed to be set to 1 when the page loads. This value of 1 is then
sent to the server which interprets it as a need to output the json
instead of the HTML. If I alert the value of the ajax input after
setting it, it returns 1, but if I alert this value in beforeSubmit of
the ajaxForm() call, it outputs 0. It is also outputting 0 to the
server, but only in IE.

Any thoughts?

//-----------------------------------------------------------------------
        $(document).ready(function(){

                $('input#insert_person_modal_ajax').val(1);
                        
//-------------------------------------------------------------------
                        //
                        
//-------------------------------------------------------------------
                        $('form#insert_person_modal').ajaxForm({
                                beforeSubmit: function(){ alert($
('input#insert_person_modal_ajax').val())},
                                dataType: 'json',
                                success: function(data, statusText, jqForm){
                                        handle_error_array(data.error_array, 
$(jqForm));
                                        if('insert_id' in data){
                                                
$("div#insert_person_modal_popup").removeShadow().hide();
                                                
$('#teams_rosters_person_id').val(data.insert_id);
                                                
$('#teams_rosters_person_id_autocompletor').val($
('#insert_person_modal_first_name').val() + ' ' + $
('#insert_person_modal_last_name').val());
                                        }
                                },
                                error: function(XMLHttpRequest, textStatus, 
errorThrown){
                                        alert(errorThrown + " " + textStatus + 
" " + XMLHttpRequest);
                                }
                        });
                        
//-------------------------------------------------------------------


                        
//-----------------------------------------------------------------------
                        $('a.pop_up_form').live("click", function(event){
                                event.preventDefault();
                                $(this).parent().removeShadow();
                                $(this).parent().hide();
                        });
                        
//-----------------------------------------------------------------------

 
                        
//-------------------------------------------------------------------
                        //
 
                        
//-------------------------------------------------------------------
                        
$("img.add_person_autocomplete_action").click(function(event){
                                $("form#insert_person_modal").resetForm();
                                $("div#insert_person_modal_popup").css("width", 
400).css("top",
event.pageY - 100).css("left", event.pageX - 100).show().dropShadow
({left: 0, top: 3, blur: 5});
                        })
 
                        
//-------------------------------------------------------------------

                });
 
                
//-----------------------------------------------------------------------

On Dec 22, 7:29 pm, Mike Alsup <mal...@gmail.com> wrote:
> Set a breakpoint in jQuery's httpData function and see why it's
> failing.
>
> Mike
>
> On Dec 22, 8:11 pm, dirknibleck <paul.ship...@clickonce.ca> wrote:
>
>
>
> > I have what I think is a pretty basic function going on that fails in
> > IE everytime. The code is below.  The javascript is first, followed by
> > the ajax response.
>
> > In IE, the ajaxForm() function doesn't resolve to success, but it does
> > in FireFox, Opera and Safari
>
> > On IE, the error: function() returns "parseerror" from the textStatus
> > variable.
>
> > What can I change to fix this?
>
> > $('form#insert_person_modal').ajaxForm({
> >         dataType: 'json',
> >         success: function(data, statusText, jqForm){
> >                 handle_error_array(data.error_array, $(jqForm));
> >                 if('insert_id' in data){
> >                         $("div#insert_person_modal_popup").removeShadow
> > ().hide();
> >                         $('#teams_rosters_person_id').val
> > (data.insert_id);
> >                  $('#teams_rosters_person_id_autocompletor').val($
> > ('#insert_person_modal_first_name').val() + ' ' + $
> > ('#insert_person_modal_last_name').val());
> >                 }
> >         },
> >         error: function(XMLHttpRequest, textStatus, errorThrown){
> >                 alert("error thrown " + errorThrown);
> >                 alert("text status " + textStatus);
> >                 alert("Request " + XMLHttpRequest);
> >         }
>
> > });
>
> > AJAX request (as JSON):
>
> > {"error_array":{"home_association":"The Association you have entered
> > is not a valid option. Please select another Association and try
> > again."}}
>
> > RESPONSE HEADERS:
>
> > Date    Wed, 23 Dec 2009 00:40:48 GMT
> > Server  Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.7l DAV/2 PHP/
> > 5.2.5
> > X-Powered-By    PHP/5.2.5
> > Expires Thu, 19 Nov 1981 08:52:00 GMT
> > Cache-Control   no-store, no-cache, must-revalidate, post-check=0, pre-
> > check=0
> > Pragma  no-cache
> > Content-Length  602
> > Keep-Alive      timeout=5, max=100
> > Connection      Keep-Alive
> > Content-Type    application/json

Reply via email to