<! doctype html> <html> <head> <meta charset = utf-8> <title> مثال قاعدة البيانات </title> <script type = text/javaScript charset = utf-8 src = cordova.js> </script> <script type = text/javaScript charset = utf-8> document.adDeventListener (deviceready ، ondeviceready ، false) ؛ دالة onDeviceready () {} وظيفة storename () {var myName = document.getElementById (name) .value ؛ window.localStorage.setItem (name ، myName) ؛ // 存储 var result = document.getElementById (result) ؛ result.innerhtml = اسمك هو+window.localStorage.getItem (name) ؛ // 取出存储值 return false ؛ } </script> </head> <body> <porm> <p> ما هو اسمك؟ <br/> <input type = 'text' id = 'name' onKeyup = 'storename ()'> </p > // 键盘弹起 <type type = 'text' id = 'name' onblur = 'storename ()'> </p> // 焦点移到输入框外 </form> <div id = 'result'> إظهار المحتوى </div> </body> </html>
以上这篇使用 phonegap 进行本地存储的实现方法就是小编分享给大家的全部内容了 , 希望能给大家一个参考 , 也希望大家多多支持 vevb 武林网。