|
@@ -1,42 +1,31 @@
|
|
|
<!DOCTYPE html>
|
|
|
<html lang="en">
|
|
|
+
|
|
|
<head>
|
|
|
<meta charset="UTF-8">
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
|
<title>Googo Website Traffic</title>
|
|
|
<!-- Font Awesome -->
|
|
|
- <link
|
|
|
- href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css"
|
|
|
- rel="stylesheet"
|
|
|
- />
|
|
|
+ <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css" rel="stylesheet" />
|
|
|
<!-- Google Fonts -->
|
|
|
- <link
|
|
|
- href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
|
|
|
- rel="stylesheet"
|
|
|
- />
|
|
|
+ <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />
|
|
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
|
|
|
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
|
|
|
<!-- MDB -->
|
|
|
- <link
|
|
|
- href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/3.3.0/mdb.min.css"
|
|
|
- rel="stylesheet"
|
|
|
- />
|
|
|
+ <link href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/3.3.0/mdb.min.css" rel="stylesheet" />
|
|
|
<link rel="stylesheet" href="https://unpkg.com/js-datepicker/dist/datepicker.min.css">
|
|
|
<link rel="stylesheet" type="text/css" href="reset.css">
|
|
|
<link rel="stylesheet" type="text/css" href="main.css">
|
|
|
<!-- MDB -->
|
|
|
- <script
|
|
|
- type="text/javascript"
|
|
|
- src="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/3.3.0/mdb.min.js"
|
|
|
- ></script>
|
|
|
+ <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/3.3.0/mdb.min.js"></script>
|
|
|
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
|
|
|
<script src="echarts.min.js"></script>
|
|
|
<style>
|
|
|
body {
|
|
|
font-family: 'Lato', sans-serif;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.overlay {
|
|
|
height: 100%;
|
|
|
width: 100%;
|
|
@@ -45,10 +34,10 @@
|
|
|
z-index: 1;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
- background-color: rgb(0,0,0);
|
|
|
- background-color: rgba(0,0,0, 0.6);
|
|
|
+ background-color: rgb(0, 0, 0);
|
|
|
+ background-color: rgba(0, 0, 0, 0.6);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.overlay-content {
|
|
|
position: relative;
|
|
|
top: 25%;
|
|
@@ -56,7 +45,7 @@
|
|
|
text-align: center;
|
|
|
margin-top: 30px;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.overlay a {
|
|
|
padding: 8px;
|
|
|
text-decoration: none;
|
|
@@ -65,48 +54,52 @@
|
|
|
display: block;
|
|
|
transition: 0.3s;
|
|
|
}
|
|
|
-
|
|
|
- .overlay a:hover, .overlay a:focus {
|
|
|
+
|
|
|
+ .overlay a:hover,
|
|
|
+ .overlay a:focus {
|
|
|
color: #f1f1f1;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.overlay .closebtn {
|
|
|
position: absolute;
|
|
|
top: 20px;
|
|
|
right: 45px;
|
|
|
font-size: 60px;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@media screen and (max-height: 450px) {
|
|
|
- .overlay a {font-size: 20px}
|
|
|
+ .overlay a {
|
|
|
+ font-size: 20px
|
|
|
+ }
|
|
|
+
|
|
|
.overlay .closebtn {
|
|
|
- font-size: 40px;
|
|
|
- top: 15px;
|
|
|
- right: 35px;
|
|
|
+ font-size: 40px;
|
|
|
+ top: 15px;
|
|
|
+ right: 35px;
|
|
|
}
|
|
|
}
|
|
|
- </style>
|
|
|
+ </style>
|
|
|
</head>
|
|
|
+
|
|
|
<body class="color__grey">
|
|
|
<div id="myNav" class="overlay">
|
|
|
<div class="overlay-content">
|
|
|
<a href="#">載入資料中,請稍候</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
-<!-- Navbar -->
|
|
|
+ <!-- Navbar -->
|
|
|
<nav class="navbar navbar-expand-lg navbar-light bg-white">
|
|
|
<!-- Container wrapper -->
|
|
|
<div class="container-fluid">
|
|
|
<!-- Navbar brand -->
|
|
|
<a class="navbar-brand" href="#">Googo Website Traffic</a>
|
|
|
-
|
|
|
+
|
|
|
<!-- Toggle button -->
|
|
|
- <button class="navbar-toggler" type="button" data-mdb-toggle="collapse"
|
|
|
- data-mdb-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false"
|
|
|
- aria-label="Toggle navigation">
|
|
|
+ <button class="navbar-toggler" type="button" data-mdb-toggle="collapse" data-mdb-target="#navbarSupportedContent"
|
|
|
+ aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
|
|
<i class="fas fa-bars text-light"></i>
|
|
|
</button>
|
|
|
-
|
|
|
+
|
|
|
<!-- Collapsible wrapper -->
|
|
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
|
|
<!-- Left links -->
|
|
@@ -150,248 +143,249 @@
|
|
|
<div class="row">
|
|
|
<!-- <div class="col-1 col-lg-1"></div> -->
|
|
|
<div class="col-12 col-12">
|
|
|
- <!-- Search form -->
|
|
|
+ <!-- Search form -->
|
|
|
<form id="searchform" class="d-flex input-group search__form">
|
|
|
- <input type="search" class="form-control search__bar" placeholder="在此輸入網址" aria-label="Domain Name" id="search_query" />
|
|
|
- <button class="btn btn-primary search__btn" type="button" data-mdb-ripple-color="dark" id="search__btn" >
|
|
|
- 查詢
|
|
|
+ <input type="search" class="form-control search__bar" placeholder="在此輸入網址" aria-label="Domain Name"
|
|
|
+ id="search_query" />
|
|
|
+ <button class="btn btn-primary search__btn" type="button" data-mdb-ripple-color="dark" id="search__btn">
|
|
|
+ 查詢
|
|
|
</button>
|
|
|
</form>
|
|
|
- <h3 class="h3 text-center" id="sitename">Website Traffic</h3>
|
|
|
- <div class="card card__grback mb-4">
|
|
|
- <div class="card-body card__left">
|
|
|
- <!-- 根據搜尋內容顯示網站標題及網站內容簡介 -->
|
|
|
- <h5 class="card-title card__url" id="sitetitle"><i class="fas fa-chart-bar card__url__icon"></i>Example.com</h5>
|
|
|
- <p class="card-text card__intro" id="descriptions">
|
|
|
- Lorem ipsum dolor sit amet consectetur adipisicing elit. Ut ipsa totam maxime pariatur iure
|
|
|
- suscipit nihil possimus deserunt esse blanditiis. Quidem aliquid, voluptas quae tenetur quaerat
|
|
|
- iure explicabo repellat ad.
|
|
|
+ <h3 class="h3 text-center" id="sitename">Website Traffic</h3>
|
|
|
+ <div class="card card__grback mb-4">
|
|
|
+ <div class="card-body card__left">
|
|
|
+ <!-- 根據搜尋內容顯示網站標題及網站內容簡介 -->
|
|
|
+ <h5 class="card-title card__url" id="sitetitle"><i class="fas fa-chart-bar card__url__icon"></i>Example.com
|
|
|
+ </h5>
|
|
|
+ <p class="card-text card__intro" id="descriptions">
|
|
|
+ Lorem ipsum dolor sit amet consectetur adipisicing elit. Ut ipsa totam maxime pariatur iure
|
|
|
+ suscipit nihil possimus deserunt esse blanditiis. Quidem aliquid, voluptas quae tenetur quaerat
|
|
|
+ iure explicabo repellat ad.
|
|
|
+ </p>
|
|
|
+ <!-- <a href="#" class="btn btn-primary" id="globalrank2"></a> -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="text-muted mb-2 border-bottom">排行</div>
|
|
|
+ <div class="row g-5 mb-3">
|
|
|
+ <div class="col-sm-4">
|
|
|
+ <div class="card p-3">
|
|
|
+ <div class="card-body text-center">
|
|
|
+ <h5 class="card-title card__rank__title mb-2">國際排行</h5>
|
|
|
+ <p class="card-text">
|
|
|
</p>
|
|
|
- <!-- <a href="#" class="btn btn-primary" id="globalrank2"></a> -->
|
|
|
+ <span href="#" class="rank__mark"># <strong id="globalrank" class="rank_num">1000</strong></span>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
- <div class="text-muted mb-2 border-bottom">排行</div>
|
|
|
- <div class="row g-5 mb-3">
|
|
|
- <div class="col-sm-4">
|
|
|
- <div class="card p-3">
|
|
|
- <div class="card-body text-center">
|
|
|
- <h5 class="card-title card__rank__title mb-2">國際排行</h5>
|
|
|
- <p class="card-text" >
|
|
|
- </p>
|
|
|
- <span href="#" class="rank__mark"># <strong id="globalrank" class="rank_num">1000</strong></span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="col-sm-4">
|
|
|
- <div class="card p-3">
|
|
|
- <div class="card-body text-center">
|
|
|
- <h5 class="card-title card__rank__title mb-2">國內排行</h5>
|
|
|
- <p class="card-text">
|
|
|
- </p>
|
|
|
- <span href="#" class="rank__mark"># <strong id="countryrank" class="rank_num">100</strong></span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-sm-4">
|
|
|
+ <div class="card p-3">
|
|
|
+ <div class="card-body text-center">
|
|
|
+ <h5 class="card-title card__rank__title mb-2">國內排行</h5>
|
|
|
+ <p class="card-text">
|
|
|
+ </p>
|
|
|
+ <span href="#" class="rank__mark"># <strong id="countryrank" class="rank_num">100</strong></span>
|
|
|
</div>
|
|
|
- <div class="col-sm-4">
|
|
|
- <div class="card p-3">
|
|
|
- <div class="card-body text-center">
|
|
|
- <h5 class="card-title card__rank__title mb-2"><i class="fas fa-tags"></i>網站類別</h5>
|
|
|
- <p class="card-text card__rank__cat" id="category">
|
|
|
- Lorem
|
|
|
- </p>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-sm-4">
|
|
|
+ <div class="card p-3">
|
|
|
+ <div class="card-body text-center">
|
|
|
+ <h5 class="card-title card__rank__title mb-2"><i class="fas fa-tags"></i>網站類別</h5>
|
|
|
+ <p class="card-text card__rank__cat" id="category">
|
|
|
+ Lorem
|
|
|
+ </p>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="text-muted mt-5 mb-2">Global Website Traffic Rankings</div>
|
|
|
- <div class="row mb-4">
|
|
|
- <div class="col-12 col-12">
|
|
|
- <!--
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="text-muted mt-5 mb-2">Global Website Traffic Rankings</div>
|
|
|
+ <div class="row mb-4">
|
|
|
+ <div class="col-12 col-12">
|
|
|
+ <!--
|
|
|
<button type="button" class="btn btn-primary btn-block mb-4 ripple-surface">Place order</button>
|
|
|
-->
|
|
|
- <div class="card card__notHover">
|
|
|
- <div id="main" class="chart"></div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="text-muted mb-2 border-bottom">BENEFIT</div>
|
|
|
- <div class="btn-group group__btn" role="group" aria-label="date-buttons">
|
|
|
- <button class="btn__benefit active">搜尋流量</button>
|
|
|
+ <div class="card card__notHover">
|
|
|
+ <div id="main" class="chart"></div>
|
|
|
</div>
|
|
|
- <div class="row g-5 mb-3">
|
|
|
- <div class="col-sm-4">
|
|
|
- <div class="card p-3">
|
|
|
- <div class="card-body text-center">
|
|
|
- <h5 class="card-title card__rank__title mb-2">搜尋流量</h5>
|
|
|
- <p class="card-text" >
|
|
|
- </p>
|
|
|
- <span href="#" class="rank__mark"><strong id="maxflow" class="rank_num">1000</strong></span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="text-muted mb-2 border-bottom">BENEFIT</div>
|
|
|
+ <div class="btn-group group__btn" role="group" aria-label="date-buttons">
|
|
|
+ <button class="btn__benefit active">搜尋流量</button>
|
|
|
+ </div>
|
|
|
+ <div class="row g-5 mb-3">
|
|
|
+ <div class="col-sm-4">
|
|
|
+ <div class="card p-3">
|
|
|
+ <div class="card-body text-center">
|
|
|
+ <h5 class="card-title card__rank__title mb-2">搜尋流量</h5>
|
|
|
+ <p class="card-text">
|
|
|
+ </p>
|
|
|
+ <span href="#" class="rank__mark"><strong id="maxflow" class="rank_num">1000</strong></span>
|
|
|
</div>
|
|
|
- <div class="col-sm-4">
|
|
|
- <div class="card p-3">
|
|
|
- <div class="card-body text-center">
|
|
|
- <h5 class="card-title card__rank__title mb-2">有搜尋流量的網頁數</h5>
|
|
|
- <p class="card-text">
|
|
|
- </p>
|
|
|
- <span href="#" class="rank__mark"><strong id="countryrank" class="rank_num">100</strong></span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-sm-4">
|
|
|
+ <div class="card p-3">
|
|
|
+ <div class="card-body text-center">
|
|
|
+ <h5 class="card-title card__rank__title mb-2">有搜尋流量的網頁數</h5>
|
|
|
+ <p class="card-text">
|
|
|
+ </p>
|
|
|
+ <span href="#" class="rank__mark"><strong id="countryrank" class="rank_num">100</strong></span>
|
|
|
</div>
|
|
|
- <div class="col-sm-4">
|
|
|
- <div class="card p-3">
|
|
|
- <div class="card-body text-center">
|
|
|
- <h5 class="card-title card__rank__title mb-2"><i class="fas fa-tags"></i>轉換訂單數</h5>
|
|
|
- <span href="#" class="rank__mark"><strong id="countryrank" class="rank_num">100</strong></span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="col-sm-4">
|
|
|
+ <div class="card p-3">
|
|
|
+ <div class="card-body text-center">
|
|
|
+ <h5 class="card-title card__rank__title mb-2"><i class="fas fa-tags"></i>轉換訂單數</h5>
|
|
|
+ <span href="#" class="rank__mark"><strong id="countryrank" class="rank_num">100</strong></span>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
- <div class="text-muted mb-2 border-bottom">SEO</div>
|
|
|
- <div class="row mb-4">
|
|
|
- <div class="col-12 col-12">
|
|
|
- <!--
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="text-muted mb-2 border-bottom">SEO</div>
|
|
|
+ <div class="row mb-4">
|
|
|
+ <div class="col-12 col-12">
|
|
|
+ <!--
|
|
|
<button type="button" class="btn btn-primary btn-block mb-4 ripple-surface">Place order</button>
|
|
|
-->
|
|
|
- <div class="card card__notHover">
|
|
|
- <!--<div id="bar" class="chart"></div>-->
|
|
|
- <p id='seo_string'>asdasdasd, asdas d, asdasd, asdasd</p>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <div class="card card__notHover">
|
|
|
+ <!--<div id="bar" class="chart"></div>-->
|
|
|
+ <p id='seo_string'>asdasdasd, asdas d, asdasd, asdasd</p>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<footer class="footer text-center p-4 bg-white">
|
|
|
<div class="text-muted"> © 2021 Copyright: Googo Website Traffic</div>
|
|
|
</footer>
|
|
|
- <script
|
|
|
- src="https://code.jquery.com/jquery-3.6.0.min.js"
|
|
|
- integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
|
|
|
- crossorigin="anonymous"></script>
|
|
|
+ <script src="https://code.jquery.com/jquery-3.6.0.min.js"
|
|
|
+ integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
|
|
|
<script src="https://unpkg.com/js-datepicker"></script>
|
|
|
|
|
|
-<script>
|
|
|
- function openNav() {
|
|
|
- document.getElementById("myNav").style.display = "block";
|
|
|
-}
|
|
|
-
|
|
|
-function closeNav() {
|
|
|
- document.getElementById("myNav").style.display = "none";
|
|
|
-}
|
|
|
-$.get("http://www.googo.org:8001/random_kw", function(result){
|
|
|
- var seoStr = ''
|
|
|
- var step;
|
|
|
- for (let i=0; i<result.length; i++) {
|
|
|
- seoStr = seoStr+result[i].kw+','
|
|
|
+ <script>
|
|
|
+ function openNav() {
|
|
|
+ document.getElementById("myNav").style.display = "block";
|
|
|
}
|
|
|
- seoStr=seoStr.substring(0, seoStr.length - 1);
|
|
|
- $('#seo_string').html(seoStr)
|
|
|
-});
|
|
|
-const input = document.getElementById("search_query");
|
|
|
-const search__btn = document.getElementById("search__btn");
|
|
|
-const btn__benefit = document.querySelectorAll(".btn__benefit");
|
|
|
-
|
|
|
- $('.sub__date').click(function(e){
|
|
|
- e.preventDefault();
|
|
|
- console.log(picker_end.getRange());
|
|
|
- });
|
|
|
- search__btn.addEventListener("click", function(e) {
|
|
|
- openNav()
|
|
|
- e.preventDefault();
|
|
|
- check_form();
|
|
|
- })
|
|
|
-
|
|
|
- btn__benefit.forEach((item, i) => {
|
|
|
- item.addEventListener("click", function(){
|
|
|
- item.toggleClass('active');
|
|
|
- })
|
|
|
- });
|
|
|
- $('#search_query').keydown(function(e){
|
|
|
- //
|
|
|
- if (event.keyCode == 13){
|
|
|
- document.getElementById('search__btn').click()
|
|
|
- e.preventDefault();
|
|
|
+
|
|
|
+ function closeNav() {
|
|
|
+ document.getElementById("myNav").style.display = "none";
|
|
|
}
|
|
|
- });
|
|
|
-
|
|
|
- const myChart = echarts.init(document.getElementById('main'));
|
|
|
- let option;
|
|
|
-
|
|
|
- function check_form(){
|
|
|
-
|
|
|
- const sitename = document.getElementById('sitename');
|
|
|
- const sitetitle = document.getElementById('sitetitle');
|
|
|
- const descriptions = document.getElementById('descriptions');
|
|
|
- const globalrank = document.getElementById('globalrank');
|
|
|
- const countryrank = document.getElementById('countryrank');
|
|
|
- const category = document.getElementById('category');
|
|
|
- response = ''
|
|
|
-
|
|
|
- dataOBJ = {'keyword':$('#search_query').val()}
|
|
|
- objstr = JSON.stringify(dataOBJ);
|
|
|
- console.log(objstr)
|
|
|
-
|
|
|
- $.ajax({
|
|
|
- url: 'http://www.googo.org:8001/kw_dm',
|
|
|
- //url: 'http://www.choozmo.com:8888/qqreq',
|
|
|
- dataType : 'json', // 預期從server接收的資料型態
|
|
|
- contentType : 'application/json; charset=utf-8', // 要送到server的資料型態
|
|
|
- type: 'post',
|
|
|
- data: objstr,
|
|
|
- success: function(suc_data) {
|
|
|
-
|
|
|
- response = suc_data
|
|
|
- sitename.textContent =response.SiteName;
|
|
|
- descriptions.textContent=response.Description;
|
|
|
- globalrank.textContent=response.GlobalRank;
|
|
|
- sitetitle.textContent=response.Title;
|
|
|
- countryrank.textContent=response.CountryRank;
|
|
|
- category.textContent=response.Category;
|
|
|
- $('#maxflow').html(response.totalVisits)
|
|
|
- key_ary=[];
|
|
|
- val_ary=[];
|
|
|
-
|
|
|
- for (const [key, value] of Object.entries(response.EstimatedMonthlyVisits)) {
|
|
|
- key_ary.push(key);
|
|
|
- val_ary.push(value);
|
|
|
- }
|
|
|
-
|
|
|
- option = {
|
|
|
- xAxis: {
|
|
|
- type: 'category',
|
|
|
- boundaryGap: false,
|
|
|
- data: key_ary
|
|
|
- },
|
|
|
- yAxis: {
|
|
|
- type: 'value'
|
|
|
- },
|
|
|
- series: [{
|
|
|
- data: val_ary,
|
|
|
- type: 'line',
|
|
|
- areaStyle: {}
|
|
|
- }]
|
|
|
- };
|
|
|
- myChart.setOption(option);
|
|
|
- closeNav()
|
|
|
- },
|
|
|
- //data:JSON.stringify({n1:"12",n2:"22"}),
|
|
|
- error: function (error) {
|
|
|
- alert('此網頁無法查詢!')
|
|
|
- closeNav()
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
+ $.get("http://www.googo.org:8001/random_kw", function (result) {
|
|
|
+ var seoStr = ''
|
|
|
+ var step;
|
|
|
+ console.log(result)
|
|
|
+ for (let i = 0; i < result.length; i++) {
|
|
|
+ seoStr = seoStr + result[i].kw + ','
|
|
|
+ }
|
|
|
+ seoStr = seoStr.substring(0, seoStr.length - 1);
|
|
|
+ $('#seo_string').html(seoStr)
|
|
|
+ });
|
|
|
+ const input = document.getElementById("search_query");
|
|
|
+ const search__btn = document.getElementById("search__btn");
|
|
|
+ const btn__benefit = document.querySelectorAll(".btn__benefit");
|
|
|
+
|
|
|
+ $('.sub__date').click(function (e) {
|
|
|
+ e.preventDefault();
|
|
|
+ console.log(picker_end.getRange());
|
|
|
+ });
|
|
|
+ search__btn.addEventListener("click", function (e) {
|
|
|
+ openNav()
|
|
|
+ e.preventDefault();
|
|
|
+ check_form();
|
|
|
+ })
|
|
|
+
|
|
|
+ btn__benefit.forEach((item, i) => {
|
|
|
+ item.addEventListener("click", function () {
|
|
|
+ item.toggleClass('active');
|
|
|
+ })
|
|
|
+ });
|
|
|
+ $('#search_query').keydown(function (e) {
|
|
|
+ //
|
|
|
+ if (event.keyCode == 13) {
|
|
|
+ document.getElementById('search__btn').click()
|
|
|
+ e.preventDefault();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ const myChart = echarts.init(document.getElementById('main'));
|
|
|
+ let option;
|
|
|
+
|
|
|
+ function check_form() {
|
|
|
+
|
|
|
+ const sitename = document.getElementById('sitename');
|
|
|
+ const sitetitle = document.getElementById('sitetitle');
|
|
|
+ const descriptions = document.getElementById('descriptions');
|
|
|
+ const globalrank = document.getElementById('globalrank');
|
|
|
+ const countryrank = document.getElementById('countryrank');
|
|
|
+ const category = document.getElementById('category');
|
|
|
+ response = ''
|
|
|
+
|
|
|
+ dataOBJ = { 'keyword': $('#search_query').val() }
|
|
|
+ objstr = JSON.stringify(dataOBJ);
|
|
|
+ console.log(objstr)
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ url: 'http://www.googo.org:8001/kw_dm',
|
|
|
+ //url: 'http://www.choozmo.com:8888/qqreq',
|
|
|
+ dataType: 'json', // 預期從server接收的資料型態
|
|
|
+ contentType: 'application/json; charset=utf-8', // 要送到server的資料型態
|
|
|
+ type: 'post',
|
|
|
+ data: objstr,
|
|
|
+ success: function (suc_data) {
|
|
|
+
|
|
|
+ response = suc_data
|
|
|
+ sitename.textContent = response.SiteName;
|
|
|
+ descriptions.textContent = response.Description;
|
|
|
+ globalrank.textContent = response.GlobalRank;
|
|
|
+ sitetitle.textContent = response.Title;
|
|
|
+ countryrank.textContent = response.CountryRank;
|
|
|
+ category.textContent = response.Category;
|
|
|
+ $('#maxflow').html(response.totalVisits)
|
|
|
+ key_ary = [];
|
|
|
+ val_ary = [];
|
|
|
+
|
|
|
+ for (const [key, value] of Object.entries(response.EstimatedMonthlyVisits)) {
|
|
|
+ key_ary.push(key);
|
|
|
+ val_ary.push(value);
|
|
|
+ }
|
|
|
+
|
|
|
+ option = {
|
|
|
+ xAxis: {
|
|
|
+ type: 'category',
|
|
|
+ boundaryGap: false,
|
|
|
+ data: key_ary
|
|
|
+ },
|
|
|
+ yAxis: {
|
|
|
+ type: 'value'
|
|
|
+ },
|
|
|
+ series: [{
|
|
|
+ data: val_ary,
|
|
|
+ type: 'line',
|
|
|
+ areaStyle: {}
|
|
|
+ }]
|
|
|
+ };
|
|
|
+ myChart.setOption(option);
|
|
|
+ closeNav()
|
|
|
+ },
|
|
|
+ //data:JSON.stringify({n1:"12",n2:"22"}),
|
|
|
+ error: function (error) {
|
|
|
+ alert('此網頁無法查詢!')
|
|
|
+ closeNav()
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
-</script>
|
|
|
+ </script>
|
|
|
|
|
|
</body>
|
|
|
|
|
|
-
|
|
|
-</html>
|
|
|
+
|
|
|
+</html>
|