【发布时间】:2015-01-24 10:26:32
【问题描述】:
$(document).ready(function()
{
$("#btnTrigger").on('click',function(){
$.ajax({
url:'https://airbnb.p.mashape.com/s',
type:'Get',
data:{location:$("boxArea").val()},
datatype:'json',
success:function(data) {
alert(JSON.stringify(data));
$("#boxArea").val(JSON.stringify(data));
},
error:function(err)
{
alert(err);
},
beforeSend:function(Xhr) {
Xhr.setRequestHeader("X-Mashape-Authorization","7MooPcOHR9mshGWoRGqd4h4UMv2Cp1kFLV3jsn3UDWi3yIxSot");
}
});
});
});
因为这在 js fiddle 上运行良好,但当我在 php 中运行时无法运行.....请帮助了解如何生成 airbnb.com 的 api 并在 php 中使用它
【问题讨论】: