views:

45

answers:

1

Hi,

I am trying to find a client-side way to determine if a page on a remote domain has changed.

I can't load the page in an iframe and examine its contents due to same origin policy.

So I tried using .getResponseHeader("Content-Length") and .getResponseHeader("Last-Modified") but apparently these are also restricted by SOP even though FireBug shows Content-Length in the console.

Is there a way to do this? I just need a way to know if the page has changed.

Thx

A: 

You can't do it completely client-side unless the other end supports CORS, or JSONP, or some other cross-origin mechanism for doing it. In the absense of that, your only options are:

  • Using server-side help
  • Using a signed script (which your users would have to grant permission to)
  • Using a signed Java applet (which your users would have to grant permission to)
  • Using an ActiveX control (which your users would have to grant permission to)

...you get the idea.

T.J. Crowder