0

I am working on an intranet application that uses the Google Visualization API to produce charts.

My question is is there a way to determine if access to https://www.google.com/jsapi server is down or blocked due to the company use of iPrism and display that information simply to the user on the page.

I know iPrism dosn't block it on my machine but i'm not sure about the client machines or that it may change in the future.

Any help is aapreciated.

JosephK
  • 101
  • 1
  • 2
  • 13

1 Answers1

2

I don't think there is anything you can trigger of of a script tag failing to load, but you could try to catch the failure before calling google.load, maybe with something like this?

if (typeof(google) == 'object' && typeof(google.load) == 'function') {
    google.load('visualization', '1', {packages:['corechart'], callback: drawChart});
}
else {
    // display error message about failing to load jsapi
}
asgallant
  • 26,060
  • 6
  • 72
  • 87
  • This does work, i originally tried to dynamically create a script so i could tie an event handler to it but that only caused more problems with google.load clearing the screen. Thanks for the help – JosephK Oct 01 '13 at 20:49