How to consume cross site asmx returned Json service with Javascript
Hi There, If you are trying to access a web service which is hosted on other domain or port or outside the network, you need to use jsonp instead of json. After spending hours, finally i found a solution on stackoverflow ( the only friend site of developers :o) Thanks to NickG for writing this answer). You can read the inside story of this issue on the actual question on stackoverflow. I am posting here the direct code which worked for me. Hope you get some clue from here. Javascript / Jquery Code: $ . ajax ({ crossDomain : true , contentType : "application/json; charset=utf-8" , url : "http://localhost:8080/Service.asmx/MyCustomMethodName" , data : { User : 'Admin' , Mon : 8 }, // example of parameter being passed dataType : "jsonp" , success : onDataReceived }); function onDataReceived ( data ) { aler...