Skip to Main Content
建構Android應用程式--使用HTML、CSS和JavaScript 第二版
book

建構Android應用程式--使用HTML、CSS和JavaScript 第二版

by Jonathan Stark, Brian Jepson
May 2012
Intermediate to advanced content levelIntermediate to advanced
176 pages
3h 43m
Chinese
GoTop Information, Inc.
Content preview from 建構Android應用程式--使用HTML、CSS和JavaScript 第二版
90
第五章
5.4
Chrome
的「
Developer Tools
」裏的「
Storage
」標籤頁可讓你對資料庫執行任何的
SQL
敘述
插入資料列
現在,我們有個資料庫設立好,可接受一些資料項,我們可以開始建立
createEntry()
式。首先,你得改寫
#createEntry
表單的
submit
事件。做法是把
createEntry()
連結至
kilo.js
document ready
函式裏的
submit
事件(只顯示前幾行,新增的部份以粗體顯示):
$(document).ready(function(){
$('#createEntry form').submit(createEntry);
$('#settings form').submit(saveSettings);
$('#settings').bind('pageAnimationStart', loadSettings);
...
現在,當使用者交付
#createEntry
表單,
createEntry()
函式就會被呼叫。接著,把下列
程式碼加入
kilo.js
,在資料庫內建立記錄:
function createEntry() {
var date = sessionStorage.currentDate;
var calories = $('#calories').val();
var food = $('#food').val();
db.transaction(
function(transaction) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

大模型应用开发极简入门 : 基于GPT-4和ChatGPT

大模型应用开发极简入门 : 基于GPT-4和ChatGPT

Olivier Caelen, Marie-Alice Blete
HBase管理指南

HBase管理指南

Posts & Telecom Press, Yifeng Jiang
自然语言处理与计算语言学

自然语言处理与计算语言学

Posts & Telecom Press, Bhargav Srinivasa-Desikan

Publisher Resources

ISBN: 9789862764817