我必须在按钮点击功能期间显示进度图像。这是我的jquery代码片段:
$( function() {
$('#loginButton').click(function() {
db = openDatabase("DBNAME", "1.0", "DBNAME", 200000);
createAndroidMetadataTable();
insertAndroidMetadataTable();
function reachableCallback(reachability) {
// There is no consistency on the format of reachability
var networkState = reachability.code || reachability;
var states = {};
states[NetworkStatus.NOT_REACHABLE] = 'No network connection';
states[NetworkStatus.REACHABLE_VIA_CARRIER_DATA_NETWORK] = 'Carrier data connection';
states[NetworkStatus.REACHABLE_VIA_WIFI_NETWORK] = 'WiFi connection';
alert('Connection type: ' + states[networkState]);
}
});
document.addEventListener("deviceready", onDeviceReady, false);
} );
这是我的HTML代码:
<div data-role="header" data-position="fixed">
<h1>Download Data</h1>
<div class="ui-body ui-body-b">
Email: <input type="text" name="userid" id="useridBox" value="" data-theme="a" />
Password: <input type="password" name="passwd" id="passwdBox" value="" data-theme="a" />
<button type="submit" data-theme="a" id="loginButton">Login</button>
</div>
在上面的HTML div标签中,我必须在用户登录时显示进度图像。请帮我修改登录按钮功能中的代码。