I'm trying build a website for the purpose of helping users to analyse links of a website which they submit to my website.
Steps like this:
- User paste a website link into my "search box".
- JS download the source html content and post to my server.
- My server show analysis result to user.
But actually JS cannot load html source of others website. How could I solve it?
I have this JS code already:
function dosubmit() {
var url = document.getElementById("url-input").value;
$.ajax({
url:url,
crossOrigin: true,
success: function(response){
alert(response);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(errorThrown);
}
})
}