我正在向我的API提出GET请求
$.get('www.test.com/api.php', {
action: 'getItems',
name: settings.name,
id: settings.id
}, function(data){}
如何将AJAX请求网址(www.test.com/api.php?action=getItems&name=names&id=3
)保存到变量?
答案 0 :(得分:0)
试试这个
var url = 'www.test.com/api.php';
$.get(url, {action: 'getItems', name: settings.name,id: settings.id},function(data){}