I want to get the html respond page from the cross domain url.
for this I am using the ajax request as,
$.ajax({
type: 'GET',
url: "http://wcidevapps.com/salescentral/idisk/0001000383/iDisk",
dataType: "jsonp",
success: function (response) {
$(response).find('li a').each(function () {
listHref.push($(this).attr('href'));
});
}
});
But after requesting it doesn't respond with any result back.
If you are using asp.net web service then you need to add this to webconfig file;
My suspicion is that you see the issue because the page you're requesting does not respond with a json(p) response, but responds with a redirect to:
(note the trailing slash)
which then returns content type:
Edit: If your intention is to retrieve the above site's data cross-domain, for further parsing by your script, I suggest that you choose one of the following:
Assumption 1: YOU are in control of the pages on server "http://wcidevapps.com"
In that case, you have two options: Either add CORS header "Access-Control-Allow-Origin: *" to the response (and configure the client ajax() call with dataType:"html"), or create a special JSON(P) page that delivers the same data as JSON (with padding) (and configure the client ajax() call like in the OP, with dataType:"jsonp")
Assumption 2: YOU are NOT in control of the pages on server http://wcidevapps.com
In that case, the only option I can think of is setup a proxy on a site that you control. Have that proxy "proxy" the requests/responses to "http://wcidevapps.com", but add the CORS header "Access-Control-Allow-Origin: *" to the response (and configure the client ajax() call with dataType:"html")
Check documentation : http://api.jquery.com/jQuery.ajax/