当我单击登录链接时,我试图激活警报,令人惊讶的是没有任何反应。我需要一些帮助。
我想在单击登录链接时弹出警报,但令人惊讶的是没有任何反应。谢谢,米克
<!DOCTYPE html>
<html>
<head>
<title>Facebook Client-side Authentication Example</title>
<script src="jquery.js" type="text/javascript"></script>
</head>
<body>
<div id="fb-root"></div>
<script type="text/javascript">
// want Alert to popup when I click on auth-loginlink
$("#auth-loginlink").on("click",function () {
alert("hi hello");
});
// ultimately I would like this to be binded with login and logout link
$("#auth-logoutlink").on("click", bindLogout);
function bindLogin(event){
alert("hello");
//FB.login();
};
function bindLogout(event){
alert("Out !!!");
//FB.logout();
};
</script>
<h1>Facebook Client-side Authentication Example</h1>
<div id="auth-status">
<div id="auth-loggedout">
<a href="#" id="auth-loginlink">Login</a>
</div>
<div id="auth-loggedin" style="display:none">
Hi, <span id="auth-displayname"></span>
(<a href="#" id="auth-logoutlink">logout</a>)
</div>
</div>
</body>
</html>