|
@@ -30,6 +30,48 @@
|
|
</head>
|
|
</head>
|
|
|
|
|
|
<body id="top">
|
|
<body id="top">
|
|
|
|
+<script>
|
|
|
|
+function statusChangeCallback(response) { // Called with the results from FB.getLoginStatus().
|
|
|
|
+ if (response.status === 'connected') { // 已登入
|
|
|
|
+ testAPI();
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function checkLoginState() { // Called when a person is finished with the Login Button.
|
|
|
|
+ FB.getLoginStatus(function(response) { // See the onlogin handler
|
|
|
|
+ statusChangeCallback(response);
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+window.fbAsyncInit = function() {
|
|
|
|
+ FB.init({
|
|
|
|
+ appId : '1388696554848391',
|
|
|
|
+ cookie : true, // Enable cookies to allow the server to access the session.
|
|
|
|
+ xfbml : true, // Parse social plugins on this webpage.
|
|
|
|
+ version : 'v11.0' // Use this Graph API version for this call.
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ FB.getLoginStatus(function(response) { // Called after the JS SDK has been initialized.
|
|
|
|
+ statusChangeCallback(response); // Returns the login status.
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+function testAPI() {
|
|
|
|
+ FB.api('/me/?fields=id,name,email', function(response) {
|
|
|
|
+ console.log('FB API回傳資料: ' + JSON.stringify(response));
|
|
|
|
+
|
|
|
|
+ if (response.id) {
|
|
|
|
+ // 設定欄位預設值
|
|
|
|
+ document.getElementById("email").value = response.email;
|
|
|
|
+ document.getElementById("name").value = response.name;
|
|
|
|
+
|
|
|
|
+ // 隱藏FB登入按鈕
|
|
|
|
+ document.getElementById("fb_login").style.display = 'none';
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+
|
|
<div class="container-fluid" style="padding:0;margin:0 ">
|
|
<div class="container-fluid" style="padding:0;margin:0 ">
|
|
<div class="banner container-fluid" style="padding:0; margin:0 ">
|
|
<div class="banner container-fluid" style="padding:0; margin:0 ">
|
|
<!-- <section id="banner"> -->
|
|
<!-- <section id="banner"> -->
|
|
@@ -363,10 +405,16 @@
|
|
</div>
|
|
</div>
|
|
<hr>
|
|
<hr>
|
|
<div id="form-right">
|
|
<div id="form-right">
|
|
- <div id="facebook" onclick='callFB()'>
|
|
|
|
|
|
+ <!-- <div id="facebook" onclick='callFB()'>
|
|
<img src="./img/logo/facebook.webp" alt="">
|
|
<img src="./img/logo/facebook.webp" alt="">
|
|
使用FB填入信箱與姓名
|
|
使用FB填入信箱與姓名
|
|
|
|
+ </div> -->
|
|
|
|
+
|
|
|
|
+ <div id="fb_login">
|
|
|
|
+ <fb:login-button scope="public_profile,email" onlogin="checkLoginState();">使用FB填入信箱與姓名</fb:login-button>
|
|
|
|
+ <div id="status"></div>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
<input type="text" name="email" id="email" placeholder="請輸入信箱" required>
|
|
<input type="text" name="email" id="email" placeholder="請輸入信箱" required>
|
|
<input type="text" name="name" id="name" placeholder="請輸入姓名" required>
|
|
<input type="text" name="name" id="name" placeholder="請輸入姓名" required>
|
|
<input type="text" name="phone" id="phone" placeholder="請輸入電話" required>
|
|
<input type="text" name="phone" id="phone" placeholder="請輸入電話" required>
|
|
@@ -400,40 +448,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-<!-- <script>
|
|
|
|
-window.fbAsyncInit = function() {
|
|
|
|
- FB.init({
|
|
|
|
- appId : '582473075602626',
|
|
|
|
- cookie : true,
|
|
|
|
- xfbml : true,
|
|
|
|
- version : '{api-version}'
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- FB.AppEvents.logPageView();
|
|
|
|
-
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-(function(d, s, id){
|
|
|
|
- var js, fjs = d.getElementsByTagName(s)[0];
|
|
|
|
- if (d.getElementById(id)) {return;}
|
|
|
|
- js = d.createElement(s); js.id = id;
|
|
|
|
- js.src = "https://connect.facebook.net/en_US/sdk.js";
|
|
|
|
- fjs.parentNode.insertBefore(js, fjs);
|
|
|
|
-}(document, 'script', 'facebook-jssdk'));
|
|
|
|
-
|
|
|
|
-FB.getLoginStatus(function(response) {
|
|
|
|
- statusChangeCallback(response);
|
|
|
|
-});
|
|
|
|
-</script> -->
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ <!-- Load the JS SDK asynchronously -->
|
|
|
|
+ <script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js"></script>
|
|
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js"
|
|
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js"
|
|
integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p"
|
|
integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p"
|
|
@@ -443,6 +459,7 @@ FB.getLoginStatus(function(response) {
|
|
crossorigin="anonymous"></script>
|
|
crossorigin="anonymous"></script>
|
|
|
|
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
|
|
|
+
|
|
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.min.js"></script>
|
|
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/slick-carousel@1.8.1/slick/slick.min.js"></script>
|
|
|
|
|
|
<script src="./goto.js"></script>
|
|
<script src="./goto.js"></script>
|