This is the question that my friend asked me today, and it hit me all day. I messed up dozens of forums looking for the right way to get external html content and show it on my page .
I want to go to http://www.someExternalURL.com and get all the html from this page. I tried the following:
$.ajax ({ url: "http://www.someExternalURL.com", type: "GET", cache: false, crossDomain: true, data: {}, jsonp: 'jsonCallback', dataType: "jsonp", success: function (data) { alert('good'); jsonCallback = data.Result; }, error: function (e) { alert(e.responseText); } });
Does not work.
Then I tried:
var all; $.get("http://localhost:60939/About.aspx", function (my_var) { alert(my_var); }
Just that the latter is only useful for local pages. And I need EXTERNAL
Any help would be greatly appreciated.
Thank you in advance
source share