// build the query object either from location.query, if it contains the xdm_e argument, or from location.hash
var query = (function(input){
input = input.substring(1).split("&");
var data = {}, pair, i = input.length;
while (i--) {
pair = input[i].split("=");
if (pair[0] == 'xdm_e' && pair[1].indexOf('%253A%252F%252') >= 0)
{
// XXX Workaround, when doing the Rpc example the URL gets double URI encoded
// I've walked through the code and I see it get encoded once then set as the
// created iframe src which appears to encode yet again
pair[1] = decodeURIComponent(pair[1]);
}
data[pair[0]] = decodeURIComponent(pair[1]);
}
return data;
}(/xdm_e=/.test(location.search) ? location.search : location.hash));
What am I doing wrong? Am I missing something here?
Thanks,
Dan