TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Harish Chandra Patel
1.6k
96
13.3k
How to call remote web service using Jquery?
Feb 7 2014 8:08 AM
Hi all,
I want to call remote web service using Jquery? My code is given below.
<script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$('#Save').click(TestingMethod);
}
);
function TestingMethod() {
var BizName = $('#txtBizName').val();
var webMethod = "http://MyWebService/offlinecourse.asmx/TestingMethod";
var parameters = "{str:'" + BizName + "'}";
$.ajax({
url: webMethod,
type: "POST",
dataType: "json",
data: parameters,
contentType: "application/json; charset=utf-8",
success: function(msg) {
$('#status').html('Input is : ' + msg.d);
},
error: function(e) {
$('#status').html = "Unavailable";
}
});
}
</script>
</head>
<body>
<form id="form1" runat="server">
<input type="text" id="txtBizName" />
<input type="button" id="Save" value="Save" />
<div id="status">
</div>
</form>
</body>
</html>
Reply
Answers (
1
)
Jquery to access web service method
FaultException wasunhandled