Reputation: 328
I am trying cross domain request from my js file.
First,I was trying JSONP but my target domain URL is not support it. It return plain JSON object.
I am authorize person to access my target domain URL. but i can not modify it as per JSONP response.
SO how can i get JSON response from my target domain URL?
Upvotes: 0
Views: 31862
Reputation: 4506
I have always done it with jsonp, by passing a callback b/c services return json, if call back is passed then it will wrap all json in callback else they will simple return json.
But in your case
You can look up with this article http://www.webdevdoor.com/jquery/cross-domain-browser-json-ajax/
Upvotes: 1
Reputation: 1350
Don't know what type application you are developing. But in ASP.NET you can do it by using a proxy page
These links may be helpful:
http://www.codeproject.com/Articles/667611/ASP-NET-Proxy-Page-Used-for-Cross-Domain-Requests
http://encosia.com/use-asp-nets-httphandler-to-bridge-the-cross-domain-gap/
https://gist.github.com/jkresner/3982746
Upvotes: 0
Reputation: 56467
Without modifying a bit the server side there is not much you can do. The general policy is to not to allow cross domain requests.
There are few things worth mentioning though:
Access-Control-Allow-Origin
header then you can communicate with it with normal AJAX. This feature is supported in modern browsers only. Check this out for more info.Upvotes: 1