// 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();