I am wondering if there is a simple (?) way to use JS to check if there is an update to the current page? Use AJAX to load the page and check against the current DOM? Is this possible?
Thanks,
Isaac
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could use XHR to load the page and then compare the page to the current, but it would be overkill. Serialising the DOM to do a string comparison would be a lot of unnecessary work for the JavaScript interpreter.
Instead, why not create a service, e.g. JSON, that lets you tell your page when something has updated instead of scraping the entire output?