|
本帖最后由 weejting 于 2014-2-28 12:17 编辑
<!DOCTYPE HTML>
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<title>Splash Screen Example</title>
<script type="text/javascript" charset="utf-8" src=
"cordova-2.8.1.js">
</script>
<script type="text/javascript" charset="utf-8" src="jQuery.js">
</script>
<script type="text/javascript">
// Wait for Cordova to load
//
document.addEventListener("deviceready", onDeviceReady, false);
// Cordova is ready
//
function onDeviceReady() {
navigator.splashscreen.hide();
}
function soap() {
//get current date
var currentDate = new Date();
var fromCurrency = "USD";
var toCurrency = "MYR";
var dateRate = currentDate;
var amount = 5;
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET","converter.asmx/GetConversionAmount?CurrencyFrom=fromCurrency&CurrencyTo=toCurrency&RateDate=dateRate&Amount=amount", true);
// send request
// ...
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
//alert('done use firebug to see response');
alert('Response' + xmlhttp.responseText);
}
else
{
alert('Error ' + xmlhttp.status);
}
}
}
xmlhttp.send();
}
</script>
</head>
<body>
<h1>Currency Converter</h1>
<button type="Submit">call</button>
</body>
</html>
|
|