Matt Nathanson
Matt Nathanson

Reputation: 191

IE not displaying ajax call results from database

question says it all... code:

$(document).ready(function() {
                dataToLoad = 'showresults=true';
                $.ajax({
                    type: 'post',
                    url: 'submit.php',
                    datatype: 'html',
                    data: dataToLoad,
                    async: true,
                    success: function(data){

                        $('#results').html(data);   
                    },

                });
});

Upvotes: 0

Views: 376

Answers (1)

Edgar Villegas Alvarado
Edgar Villegas Alvarado

Reputation: 18344

You should use

dataType: 'html'

instead of

datatype: 'html'

and remove the trailing comma at the end (IE<=7 will throw error)

If the problem persists, add an error callback to see if there's an error

error: function(xhr, status, errorThrown){
   alert("Error:\n" + status);
}

Hope this helps. Cheers

Upvotes: 1

Related Questions