Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function createCORSRequest(method, url){
- var xhr = new XMLHttpRequest();
- if ("withCredentials" in xhr){
- xhr.open(method, url, true);
- } else if (typeof XDomainRequest != "undefined"){
- xhr = new XDomainRequest();
- xhr.open(method, url);
- } else {
- xhr = null;
- }
- return xhr;
- }
- function CallWS(){
- var request = createCORSRequest("POST","https://**************/gateway.com");
- if (request){
- request.onload = function(){
- var res = request.responseText;
- alert(res);
- };
- request.send();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement