So I have this function that gets innerHTML from the site I’m in:
document.getElementById('go').onclick = function(){
alert(document.getElementById('hourbyhour_details').innerHTML);
};
However that’s not what I need, I want to get the innerHTML of another site I’m not in. I can use a WebRequest and a StreamReader to read the source code of the page I want and store it in a String, is there a way to send this String to the function? Or Is there just another way to get specific content like that but from a remote site, and not necesarily the one I’m in?
Thanks!
You are going to have to get around the same-origin policy to do this in Javascript. You can see more here:
Same-origin Policy
One way to get around this is JSONP, the other way is have a server-side script return the information you want from your domain. Good luck.