Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi I am using following code for currency Converter but $.ajax () does not call the web service

<script type="text/javascript">
alert('lkdfls');
$(function () {
alert('lkdfls');
$('#btnConvert').click(function () {
alert('lkdfls');
var amount = $('#txtAmount').val();
alert(amount);
var from = $('#ddlfrom').val();
alert(from);
var to = $('#ddlto').val();
alert(to);
$.ajax({
type: "POST",
JavaScript

url: "WebService.asmx/CurrencyConversion",
data: "{amount:" + amount + ",fromCurrency:'" + from + "',toCurrency:'" + to + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
alert('kk');
$('#currency_converter_result').html(data.d);
alert('dd');
}
});
});
});
</script>
Posted

1 solution

Use the browser's dev tools to debug these issues

http://forums.asp.net/t/1982579.aspx?Using+the+browser+s+dev+tools+to+diagnose+ajax+problems+and+other+things+[^]

We can't access your system so have no idea what your inputs are, if your asmx url is valid, what the code for the webservice is etc. It is far better to use the clues on the link above so that you can learn to debug these issues yourself.
 
Share this answer
 
Comments
Shrikesh_kale 21-Aug-15 6:38am    
.k thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900