您好,欢迎来到教玩游戏。
搜索
您的当前位置:首页详解HTML5如何操作WebSQL数据库

详解HTML5如何操作WebSQL数据库

来源:教玩游戏


下面通过本文给大家分享HTML5操作WebSQL数据库的实例代码,感兴趣的朋友一起看看吧

HTML代码:


<!DOCTYPE html>
<html>
 <head lang="en">
 <meta charset="UTF-8">
 <title>列车时刻表查询</title>
 <meta name="viewport" content="width=device-width,initial-scale=1">
 <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
 <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
 <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
 </head>
 <script src="js/connect.js"></script>
 <body onload="init()">
 <p data-role="page" id="pageone">
 <p data-role="header" data-position="fixed">
 <h1>列车时刻表查询</h1>
 </p>
 <p data-role="main" class="ui-content">
 <p align="center">请给我留言</p>
 <table data-role="table" class="ui-responsive">
 <thead>
 <tr>
 <th>姓名:</th>
 <th>留言:</th>
 </tr>
 </thead>
 <tbody>
 <tr>
 <td><input type="text" id="name"></td>
 <td><input type="text" id="memo"></td>
 </tr>
 </tbody>
 </table>
 <button type="submit" onclick="saveData()">留言</button>
 <table data-role="table" data-mode="" class="ui-responsive" id="datatable">
 <!--这里是留言板的显示区域-->
 </table>
 </p>
 <!--
 作者:ceet@vip.qq.com
 时间:2017-08-26
 描述:底部TAB
 -->
 <p data-role="footer" data-position="fixed">
 <p data-role="navbar">
 <ul>
 <li>
 <a href="index.html#index" data-icon="grid" class="ui-btn-active">查询</a>
 </li>
 <li>
 <a href="index.html#detail" data-rel="popup" data-icon="star">收藏</a>
 </li>
 <li>
 <a href="test.html" data-icon="comment">给我留言</a>
 </li>
 </ul>
 </p>
 </p>
 <!--收藏功能-->
 <p data-role="popup" id="myPopup" class="ui-content" data-theme="b">
 <a href="#" data-rel="back" class="ui-btn ui-btn-a ui-corner-all ui-shadow ui-btn ui-icon-delete ui-btn-icon-notext ui-btn-right">Close</a>
 <p>收藏成功,暂且不做处理!.</p>
 <p>请点击右上角有个关闭按钮</p>
 <p><b>提示:</b> 你也可以点击弹窗的外部区域来关闭弹窗。</p>
 </p>
 </p>
 </body>
</html>

JS代码:


我们有两个方法来进行软件设计:一个是让其足够的简单以至于让BUG无法藏身;另一个就是让其足够的复杂,让人找不到BUG。前者更难一些。

Copyright © 2019- lvjiaowang.com 版权所有

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务