hamza765 hamza765 - 2 months ago 7x
jQuery Question

How to send ajax request to external domain?

I have this AJAX request:

function getLinks(cn) {
url: cn,
error: function() {
success: function(data) {
return data;
type: 'get',
headers: {
'Access-Control-Allow-Origin': '*'

var insecure_links = getLinks(url);

but whenever I run it, it always scans for
instead of
(I just want the res to be the html of that page)

QUESTION: How do I modify this so that I can do a get request to a certain page and receive the HTML of that page back?

If it helps, I'm doing this on Nodejs.


You must be passing cn as google.com which may work in the browser bar but is not a valid url. Instead send cn as http://google.com