📜  $.get jquery 返回值 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:10.035000             🧑  作者: Mango

代码示例1
function showGetResult( name )
{
     var result = null;
     var scriptUrl = "somefile.php?name=" + name;
     $.ajax({
        url: scriptUrl,
        type: 'get',
        dataType: 'html',
        async: false,
        success: function(data) {
            result = data;
        } 
     });
     return result;
}