Answers for "hit web service from javascript"

0

hit web service from javascript

Use jQuery for performing POST or GET request from your html page like this :

function fun() 
{
   var data="hello";
   $.get("http://localhost/ws/service.asmx/HelloWord", function(response) {
        data = response;
   }).error(function(){
  alert("Sorry could not proceed");
});

   return data;
}
OR :

function fun() 
{
  var data="hello";
  $.post('http://localhost/ws/service.asmx/HelloWord',{},function(response) 
  {     data = response;
  }).error(function(){
  alert("Sorry could not proceed");
});

    return data;
}
Posted by: Guest on February-08-2021

Code answers related to "hit web service from javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language