I am trying to append a small autofreshing javascript to a page that already has jQuery.
I don’t have control of the site, so I can’t add a simple script to the HTML that would appear after each refresh.
I have to run the script in the console otherwise the page will only refresh once.
Here’s what I’m trying:
var x = function(){
// reload the page
jQuery('html').load(window.location.href);
// recurse every 5 seconds
setTimeout(x, 5000);
};
// init
x();
This is generating an appendChild error. I’m guessing I’m just going about this a bit wrong.
Despite the lack of belief that this is possible, this solution, while not perfect, is certainly working quite well