Front2End
  • Introduction
  • Front
    • Introduction
    • 新手入門
    • 相關連結
    • Css
    • Javascript
    • 立即函式
    • Google SpreadSheet 當資料庫
    • 資料視覺化
    • 新年快樂
    • Google御用網頁語言 Node.js
    • 世大運網頁遊戲腳本
    • YDNJS-1.Up&Going
    • YDNJS
    • 新手入門
  • 實做
    • 程式碼片段蒐集
    • 爬蟲
    • 實做: 貪吃蛇
    • 練習: z=ax+by
    • 實做: 爬八卦版的文章
    • LearnYouNode
      • 3 - 同步 IO 讀寫
      • 4 – My First Async I\/O
      • 5 - filter
      • 6 - Make it Modular
      • 7-Http Client
    • road_to_bookdown
    • FreeCodeCamp
  • End
    • node.js
Powered by GitBook
On this page

Was this helpful?

  1. Front

Google SpreadSheet 當資料庫

Previous立即函式Next資料視覺化

Last updated 5 years ago

Was this helpful?

之前一直有想說,能不能自己設計問卷網頁,然後將資料存在 google 的試算表裡面,但一直不知道該怎麼做。今天湊巧在 看到相關連結。太幸運了 ~

中間還有提到 spreadsheet轉json,用google語音念google文件。幹,好像更厲害,竟然是即時逐字稿!

輸入

<html>
<body>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

    NO: <input type="text" id="numberInput"><br><br>
    Name: <input type="text" id="nameInput"><br><br>
    Score: <input type="text" id="scoreInput"><br><br><br>

    <input type="button" value="送出" onclick="SendScore()">
    <script type="text/javascript">
        function SendScore(){
            $.get("https://script.google.com/macros/s/AKfycbwZvCG09-SiFnA7QRBjNe2jNuIVAqikeh8dEGv136cfytQQSWY/exec", {
                        "number": document.getElementById("numberInput").value,
                        "name": document.getElementById("nameInput").value,
                        "score": document.getElementById("scoreInput").value
                    },
                    function (data) {
                        document.write("--------------------------");
                        document.write("Result = "+data);
                        document.write("--------------------------");
                    });
        }
    </script>
</body>
</html>

查詢

<html>
<body>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

    NO: <input type="text" id="numberInput"><br><br>
    Name: <input type="text" id="nameInput"><br><br>
    Score: <input type="text" id="scoreInput"><br><br><br>

    <input type="button" value="送出" onclick="SendScore()">
    <script type="text/javascript">
        function SendScore(){
            $.get("https://script.google.com/macros/s/AKfycbyhBAwhs1pMXZ-wCD-lxsF_oPILjKCOQ8aynkOKrAgeMySUXFA/exec", {
                        "number": document.getElementById("numberInput").value,
                        "name": document.getElementById("nameInput").value,
                        "score": document.getElementById("scoreInput").value
                    },
                    function (data) {
                        document.write("--------------------------");
                        document.write("Result = "+data);
                        document.write("--------------------------");
                    });
        }
    </script>
</body>
</html>

我用來存放測試檔案的資料夾

(1) 線上 nodejs 讀書會
Jim: 以 Google 試算表作為簡易資料庫 (上)-- 資料庫的建立及寫入
Jim: 以 Google 試算表作為簡易資料庫 (下)-- 資料庫的讀取
https://drive.google.com/drive/folders/0B1xFGvwsMd3hcWRjSzJnV1pvTG8?usp=sharing