views:

31

answers:

3

I have this HTML manual that gets installed with my application. This manual gets updated often (3-5 times a week) and I want to warn my users if the manual is out of date.

The first thing I thought of was to create a hot-linked image to my webserver that I could use to check the version that they where using and server an 'update' image or 'no update' image. but if the user does not have an internet connection the image would show up as a broken image. And I don't want that.

Next I looked in to using a bit of Ajax to make the request from my webserver. If the user didn't have a interenet connection the Javascript would be able to fail gracefully. But I have run in to a problem. Because the manual is stored as a local file on the users PC it is considered a cross domain request (Same Origin Policy) to make request from my webserver.

Any suggestions on what else to try?

I can not just include a hyper link in the start menu to the online version of the manual, As many of my users will not have an internet connection.

A: 

You could possibly use JSONP, read more of it here:

http://www.west-wind.com/Weblog/posts/107136.aspx

http://niryariv.wordpress.com/2009/05/05/jsonp-quickly/

John Boker
+1  A: 

use $.post with a callback function to handle your response. It's "same origin policy" safe.

.post

NTulip
+1  A: 

Your first intuition seems the simplest solution to me.

Use a hot-linked image to advertise an update. Use ALT text to hide the broken image and display a helpful message to the user.

For example, you could try:

<img src="foobar.jpg?v=1.05.93" alt="Checking for updates... Offline! Connect to the internet to check for updates to this manual." name="UpdateChk" />

To be fancy, in your CSS, add a border and some padding so the IMG ALT text stands out and doesn't just look like it's a regular text part of the manual. Maybe a 1px border and 3px of margin/padding?

Ben Walther