jQueryのajaxリクエストhtmlファイル

838 ワード

jQueryのajaxリクエストhtmlファイル
var mainUrl = ‘./aaa.html'
$.ajax({
        type: 'GET',       //        POST GET
        url: mainUrl,      //     //   mainUrl     
        dataType: "html",  //"xml", "html", "script", "json", "jsonp", "text".
        beforeSend: function () {
            requesting();//         
        },
        //           
        success: function (response) {
            // console.log(response)
            $("#main").html(" ");
            $("#main").html(response);//     response   
dom }, // error: function (error) { console.log("error");// notfound(); } });