用什么函数往接受返回值
用什么函数去接受返回值
有一个API,需要用表单pos到一个地址,然后获取返回的数据。
这个我点击提交以后就会链接到 上面的API地址,如何把API地址返回的值直接显示在本页面呢,谢谢
------解决思路----------------------
你可以使用jquery的ajax函数来实现, 文档在这是http://api.jquery.com/jQuery.ajax/
------解决思路----------------------
$.ajax({
type: "POST",
url:"https://dnsapi.cn/Record.List",
data: $("#formid").serialize(),
success: function(data){
alert(data);
}
});
有一个API,需要用表单pos到一个地址,然后获取返回的数据。
<form action="https://dnsapi.cn/Record.List" method="post">
<input type="text" value="登陆邮箱地址" name="login_email">
<input type="passwd" value="登陆密码" name="login_password">
<input type="text" value="ID" name="format">
<input type="submit">
<form>
这个我点击提交以后就会链接到 上面的API地址,如何把API地址返回的值直接显示在本页面呢,谢谢
------解决思路----------------------
你可以使用jquery的ajax函数来实现, 文档在这是http://api.jquery.com/jQuery.ajax/
------解决思路----------------------
$.ajax({
type: "POST",
url:"https://dnsapi.cn/Record.List",
data: $("#formid").serialize(),
success: function(data){
alert(data);
}
});