在线文档教程

JQuer $.ajax用法

function get_logout(){
    $.ajax({
        type: "POST",
        dataType: "json",
        data: {'phone':123},
        url: "/" ,
        success: function (data) {
            
        },
        error : function() {
            
        }
    });
}
$.ajax({
    url : '/index.php/api/get_img.html',
    type: "post",
    data: JSON.stringify({
        prompt:prompt,
        negative_prompt:negative_prompt,
        n:n,
        cfg_scale:cfg_scale,
        steps:steps,
        size:size,
        style:style,
        sampler_index:sampler_index,
    }),
    contentType: 'application/json; charset=utf-8', 
    dataType: 'json',
    success: function(data) {

    },error : function(e){

    }
});