Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Javascript to test if online

  • 19-03-2010 11:53am
    #1
    Registered Users, Registered Users 2 Posts: 156 ✭✭


    The company I work for provide and online application to clients. We also provide 24 hour connectivity support.

    If a client is not online then obviously they can't access the application - with the result that the ring the on call phone waking me or one of my colleagues up at 3 / 4 / 5 AM to tell us that our software isn’t working and they need it fixed. 99% of the time their broadband is down. Usually we tell them to try access google or some other site if they can't then we tell then it is a problem with their broadband provider end the call and try (often unsuccessfully) to get back to sleep!

    I don’t want to go installing wamp or anything on their local PC as this would defeat the whole SaaS (software as a service) model. However if I could send them a html page that would run some javascript to do the following -

    - check (ping) our site/app is accessible
    - check google and yahoo accessible

    If it can’t access any of those sites - display a big message saying their broadband is down - DONT ring poor Hayes!! Call your broadband provider, the problem is with them!

    Any ideas, links? Is it possible?

    Thanks


Comments

  • Registered Users, Registered Users 2 Posts: 4,780 ✭✭✭JohnK


    Maybe add a hidden iframe to the page that loads your site and another that loads google then use javascript to check after a few seconds if the iframes have any content? If they do or dont you could then display an appropriate message to the user.


  • Registered Users, Registered Users 2 Posts: 68,317 ✭✭✭✭seamus


    If they're accessing it via a webpage, then it's likely that there's nothing you can do to mitigate this. No amount of self-help guides or automated troubleshooters can fix this. If they click your link and can't access your website, they'll be on the phone to you.

    If there's any kind of thin client or if the clients have a desktop shortcut specifically for your application, then you could easily provide a "passthrough" HTML page which makes AJAX calls to your website and perhaps google to check for connectivity. If there's connectivity, then they get diredirected to your site. If there's not, they get a friendly page displayed telling them that their internet connection appears to be offline and to contact their broadband provider.

    The most effective way of fixing this problem in the short-term however is to send a mailshot to all your clients detailing commong application problems and how to troubleshoot them and informing them from 1st April, all out of hours support calls made which are not found to be a fault with your software will incur a €150 charge.

    Very quickly you'll see the calls dry up.


  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    Could you use google gears for this?

    <edit>
    Actually, do what Seamus said. Although with Gears you could, if you wanted to, provide a least a warning that their connection is down although you could also provide offline availability of your application.


  • Registered Users, Registered Users 2 Posts: 515 ✭✭✭NeverSayDie


    seamus wrote: »
    The most effective way of fixing this problem in the short-term however is to send a mailshot to all your clients detailing commong application problems and how to troubleshoot them and informing them from 1st April, all out of hours support calls made which are not found to be a fault with your software will incur a €150 charge.

    Very quickly you'll see the calls dry up.

    What he said. You'd be best to manage this as a business rather than a purely technical problem, IMO. No matter what solution you provide, someone's going to ring up as soon as they can't access your website from a link, whether that's because their net connection is down, they moved their link somewhere, etc etc. Best divert them from using your on-call service at the drop of a hat (and cover your costs better too) by charging on a per-call basis. That won't stop them calling, but at least they may think twice, and you'll know some revenue was brought in in return for your disrupted night.


  • Registered Users, Registered Users 2 Posts: 156 ✭✭dahayeser


    Thanks guys. Unfortuanately invoicing clients for these calls isn't a decision I can make and management aren't willing to do it. They can't I suppose, in the current climate they cant risk losing clients. The company it threading water as it is..

    Installing software like google gears on their clients isn't really an option. The company policy is to have little or nothing on the clients PC.

    JohnK's iframe idea is along the lines that I have been thinking. However the IFrame gets populated regardless of whether the site can be reached. I don't have a way of determining if it it populated with page not found data or the actual site. Any one have any Ideas on how this could be progressed?


  • Advertisement
  • Closed Accounts Posts: 1,827 ✭✭✭Donny5


    dahayeser wrote: »
    Thanks guys. Unfortuanately invoicing clients for these calls isn't a decision I can make and management aren't willing to do it. They can't I suppose, in the current climate they cant risk losing clients. The company it threading water as it is..

    Installing software like google gears on their clients isn't really an option. The company policy is to have little or nothing on the clients PC.

    JohnK's iframe idea is along the lines that I have been thinking. However the IFrame gets populated regardless of whether the site can be reached. I don't have a way of determining if it it populated with page not found data or the actual site. Any one have any Ideas on how this could be progressed?

    Could you put some file on your server, try to load it, and use onLoad to see if it does? You'd need to put a query on the file so it doesn't get loaded from the cache.


  • Registered Users, Registered Users 2 Posts: 4,780 ✭✭✭JohnK


    How about a simple page that visually shows the two iframes side by side with a bit of text under them saying saying what to do if one is visible and not the other. Something like this: http://www.therealjohnk.com/boards.ie/randomstuff/TestConnectivity.html


  • Registered Users, Registered Users 2 Posts: 156 ✭✭dahayeser


    Donny5 wrote: »
    Could you put some file on your server, try to load it, and use onLoad to see if it does? You'd need to put a query on the file so it doesn't get loaded from the cache.

    That won't cut it. It will only check if our site is down. I need to check our site and other sites to determine if it is our problem or their internet connection.

    It they can access others but not ours then we have a problem so I'd display a message saying saying to call us. However if they cant access any site then I tell them call there ISP - not our problem.


  • Closed Accounts Posts: 1,827 ✭✭✭Donny5


    dahayeser wrote: »
    That won't cut it. It will only check if our site is down. I need to check our site and other sites to determine if it is our problem or their internet connection.

    It they can access others but not ours then we have a problem so I'd display a message saying saying to call us. However if they cant access any site then I tell them call there ISP - not our problem.

    Okay, so try and load a file on your server, and if it fails to load, try to load another file on another server that's reliable. If that loads, then it's your problem. If neither load, it's their connection.


  • Subscribers Posts: 9,716 ✭✭✭CuLT


    Same origin policy prevents Javascript from calling to arbitrary domains, so Javascript isn't going to work here; it's probably going to need to be a local executable of some sort at least, so I'm not sure this even is a solvable problem with the caveats you have.

    Also, this is the First Law of Tech Support - if customers have a free or low cost phone number to call, they will call it, regardless of what tools or information they have at their disposal.

    Edit: it's late, and I missed JohnK's reply, which seems to be the only thing that's going to work... First Law still applies though ;)


  • Advertisement
Advertisement