Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9831

Google gadgets on sites.google

$
0
0

Is it still possible to pass url parameters to a gadget? The following code worked up until recently:

var firstGame = "ig%3D";
 var gadgetUrl = window.location.href;
 var igPos = gadgetUrl.indexOf(firstGame);
 if (igPos == -1) {
    gadgetUrl = document.referrer;
    igPos = gadgetUrl.indexOf(firstGame);
 }
 var igPos = igPos + 5;
 var firstGame = gadgetUrl.substr(igPos);
 var ig = parseInt(firstGame, 10);         
 var ourSide = "oc%3D";
 var osPos = gadgetUrl.indexOf(ourSide);
 var osPos = osPos + 5;
 var ourSide = gadgetUrl.substr(osPos);
 var ourColour = parseInt(ourSide, 10);

The url follows this format: sites.google.com/mysite/mypage?ig=99&oc=1

I need to pass the values of ig and oc to my gadget. Any help appreciated.


Viewing all articles
Browse latest Browse all 9831

Latest Images

Trending Articles



Latest Images