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 第二版
客戶端資料儲存
93
奇怪的是,
transaction
方法回呼函式的參數順序是定義成先是
error
,然後
success
(和
executeSql()
的順序相反)。這裡是加在
createEntry()
式尾端的,
transaction
回呼函式的版本(不要加入
kilo.js
,因為我們還沒定
義這些方法)
function createEntry() {
var date = sessionStorage.currentDate;
var calories = $('#calories').val();
var food = $('#food').val();
db.transaction(
function(transaction) {
transaction.executeSql(
'INSERT INTO entries (date, calories, food) VALUES (?, ?, ?);',
[date, calories, food],
function(){
refreshEntries();
jQT.goBack();
},
errorHandler
);
},
transactionErrorHandler,
transactionSuccessHandler
);
return false;
}
選取資料列以及處理結果集
下一步是擴展
refreshEntries()
函式,使其做更多的事,而非僅止於把標題列設定成選 ...
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