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;
}
Also in JavaScript:
- detect a click outside an element javascript
- remove duplicates from array of objects javascript
- javascript stringify line breaks
- are you sure javascript
- js test if string
- ejs include dynamic partial
- jquery make readonly textbox
- copy a file and paste with fs
- monk find fields
- reactjs start project
- how to get values from select multiple in js
- turn object to json javascript
- add class to html tag javascript
- get input value on keypress jquery
- javascript how to check if array is empty
- jquery get next element
- get value in maps loop using enzym
- how to add two attay into object in javascript
- js toggle boolean
- créer composant react
- js query string
- deploy react js heroku
- core.js:12799 Can't bind to 'ngForIn' since it isn't a known property of 'ng-container'.
- Warning: Failed child context type: Invalid child context `virtualizedCell.cellKey` of type