Since we are doing a cross origin JSON request, and GAS does not support CORS, we have to use JSONP. To know more about JSONP see JSONP and JSON and Google Apps Script webapps.
Here's an example of a very simple non blocking JSONP implementation.
We need to pass the current page to Retrieving page data from GAS web service we need to figure out what page we are on. Since gadgets run in an Iframe, document.referrer will be pointing to the current page. Passing this will cause a JSONP response with the stats for that page.
Services > Desktop Liberation - the definitive resource for Google Apps Script and Microsoft Office automation > Fancy gadgets on Sites >