Hi,
Please guide me i have added "http://www.webservicex.net/currencyconvertor.asmx" this currency web services in my project.I dont kniow how to call this web services in my code,
<!DOCTYPE html>
<head>
<title>Simple Currency Converter</title>
<style type="text/css">
<script type="text/javascript">
var symbol = ['US Dollar', 'British Pound', 'Euro',
'Canadian Dollar', 'Japanese Yen', 'Chinese Yuan', 'India', 'Singapore'];
var rates = [ // [symbol][USD, GBP, Euro, c$, Yen, Yuan, India, Singapore]
[1, 0.64, 0.74, 1.00, 93.83, 6.23, 53.04, 1.24],
[1.57, 1, 1.15, 1.56, 146.82, 9.76, 83.03, 1.94],
[1.36, 0.87, 1, 1.35, 127.39, 8.46, 72.01, 1.68],
[1.00, 0.64, 0.74, 1, 94.12, 6.25, 53.20, 1.24],
[0.01, 0.01, 0.01, 0.01, 1, 0.07, 0.57, 0.01],
[0.16, 0.10, 0.12, 0.16, 15.06, 1, 8.51, 0.20],
[0.02, 0.01, 0.01, 0.02, 1.74, 0.12, 1, 0.02],
[0.81, 0.51, 0.60, 0.81, 75.01, 5.03, 43.33, 1]
];
function $(x) { return document.getElementById(x); };
function $$(x) { return parseInt($(x).value, 10); };
window.onload = function () {
for (var i = 0; i < symbol.length; i++) {
$('cHave').options[i] = new Option(symbol[i], i);
$('cWant').options[i] = new Option(symbol[i], i);
}
$('amount').onfocus = function () { this.value = '' };
$('amount').onblur = calculate;
$('cHave').onchange = calculate;
$('cWant').onchange = calculate;
};
function calculate() {
var a = Math.abs($$('amount') || 0); $('amount').value = a;
var b = $$('cHave'), c = $$('cWant'), o = $('output');
if (a <= 0 || b >= rates.length || c >= rates[b].length) o.innerHTML = '';
else o.innerHTML = (a * rates[b][c]).toFixed(2) + ' ' + symbol[c];
return false; // force no submit
};
</script>
</head>
<body>
<h1>Simple Currency Converter</h1>
<hr/>
<div class="table" style="border:10px">
<form onsubmit="return calculate();" style="width: 341px">
<span class="style1">Amount (whole units)</span><input id="amount" value="0"/><br/>
<span>Convert</span><select id="cHave"></select><br/>
<span>Into</span><select id="cWant"></select><br/>
<span>Result</span><label id="output" /></div>
</form>
</div>
</body>
</html>
This is my code please guide me where i have to add this webservices for currency conversion.
Thanks,
P.LakshmiPriya