Page 116 - การโปรแกรมเว็บ
P. 116
12-104 การโปรแกรมเวบ็
ตาราง (ต่อ)
index.jsp
32 if (response.status === 'connected')
33 {
34
35
36 window.location.href='loginController.jsp?access_token='+
37 response.authResponse.accessToken;
38
39 }
40 else
41 {
42
43 document.getElementById('status').innerHTML = 'Please log into this app.';
44
45 }
46 }
47
48 </script>
49
50 <!-- สิน้ สดุ ส่วนของ code ท่ีจะให้ทำ� งานหลังจากปุ่มล็อกอินถกู คลิก -->
51
52 <!-- โคด้ ป่มุ จากเฟซบ๊กุ -->
53 <div class="fb-login-button" data-size="large" data-button-type="login_with"
54 data-auto-logout-link="true" data-use-continue-as="true"
55 onlogin=”check LoginState();"></div>
56 <!-- ******** -->
57
58 <div id="status"></div>
59
60 </body>
61 </html>
62