I have a page that has a javaScript function call on it that I am hoping to be able to grab the output of this function to use on another page and when I attempt to use:
$.get("/test.html", function(result) {
var value = $(result).html();
});
value is null. How can I call a page via ajax that would have the output of the javascript as if I had loaded that page manually?
This won’t work. Calling
document.write()on a page that has already loaded will replace the entire page:http://jsfiddle.net/JApj9/
You may be able to work something out by loading the page in a hidden iframe and reading the content of the iframe.