Hi,
I am trying to send data to a server(different domain) from client(browser). i.e client server interaction using JAVASCRIPT.
How do i do it?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Guest UserPosted Jul 15, 2014, 7:07 AM
so, something like this is being returned by WebAPI
callbackFunc({ "firstName": "sumit", "lastName": "jolly" });
# We need to set callback and data type attributes of Ajax request
# Install the JSONP MediaTypeFormatter, use NuGet
twitter @sumitjolly
Raghavendra JoshiPosted Jul 15, 2014, 1:08 AM
Pradeep ShetPosted Jul 14, 2014, 10:07 AM
Guest UserPosted Jul 14, 2014, 9:57 AM
$http.post(...) in AngularJS
or
$.post(...) in jQuery
Server doesn't allow for cross domain requests, this is security breach. To do this, server should enable CORS (http://enable-cors.org/) OR use JSONP (http://en.wikipedia.org/wiki/JSONP)
twitter @sumitjolly