title: Possible to refresh site until change with Javascript?
body: <p>I am a relatively new coder and have been searching around a bit on here and on google before asking but I have come up empty.</p>
  
  <p>I was wondering if there was a way to create a script in say Javascript, and have it refresh a page until there is a change on the page by inputting the page into a string.</p>
  
  <p>Something along the lines of (excuse the soddy psuedo-code but I realise that some functions would need to be written around this):</p>
  
  <pre><code>Start
  
  currentPage = webclient.getPage("www.somesite.com")
  boolean diff = false
  string pageText = currentPage.astext()
  
  do {
     currentPage.refresh()
  } until (currentPage.astext() != pageText)
  
  string alert = "Change Found"
  string address = "me@somesite.com"
  e-mail(address,alert)
  
  END
  </code></pre>
  
  <p>Thanks for any help anyone can offer a new coder on this :)</p>