How do I debug a jQuery Ajax request?

前端 未结 5 1705
南方客
南方客 2020-12-11 19:06

My code is:

var test = \"it isn\'t working\";
var response = $.ajax({
    type: \'GET\',
    url: \'jquerydemo.php\', //This is in the same site as the page          


        
5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-11 19:46

    To debug these types of things, I find Firebug an indispensable tool. It will show you exactly the response from the server (500 error, 553 error, what have you). You can put break points in your Javascript code and debug it step by step. Firebug works on Firefox.

    For IE, you can use the Developer Tools feature which is similar to Firebug, specially on IE9 which seems more mature than previous versions of the Developer Tools for IE7 or IE8.

提交回复
热议问题