How we can call webservice from html page using javascript
And you think his is the difficult case?
Oded
2009-12-17 13:32:40
+4
A:
Because of same origin restrictions, you might need to use JSONP through script injection.
Of course if you are talking a Web Service on the same origin, just use AJAX.
Through an web browser extension
jldupont
2009-12-17 13:22:48
IMO this is the most appropriate answer for *web services*. Here's more info on utilizing JSONP with jQuery: http://docs.jquery.com/Ajax/jQuery.getJSON and here's more info on JSONP itself: http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/
cballou
2009-12-17 13:28:21
Why not go whole-hog and just LMGTFY him? This is a place for asking questions.
T.J. Crowder
2009-12-17 13:30:59
Yes, this is definitely a place for asking questions. I believe they should also put some effort in trying to find an answer than just posting in SO and expecting someone else to solve their problem
ram
2009-12-17 13:35:31
I agree with you .. Not because anyone gets troubled with the silly questions .. but its a good thing to "TRY" before we give-up and ask some one for help .. so +1 for you ..
infant programmer
2009-12-17 13:54:35
A:
using jQuery:
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "WebService.asmx/WebMethodName",
data: "{}",
dataType: "json"
});
Mark
2009-12-17 13:24:49