开发者

IE not displaying ajax call results from database

开发者 https://www.devze.com 2023-03-02 17:12 出处:网络
question says it all... code: $(document).ready(function() { dataToLoad = \'showr开发者_运维问答esults=true\';

question says it all... code:

$(document).ready(function() {
                dataToLoad = 'showr开发者_运维问答esults=true';
                $.ajax({
                    type: 'post',
                    url: 'submit.php',
                    datatype: 'html',
                    data: dataToLoad,
                    async: true,
                    success: function(data){

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

                });
});


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

0

精彩评论

暂无评论...
验证码 换一张
取 消