On Jan 26, 8:37 pm, Rafael <[email protected]> wrote:
> URL's hashes seem to confuse the _IG_Prefs object and removing it from
> URL I get the gadget loading preferences just fine.
Yep, that's the problem all right.
> I've added your clock gadget to my Gmail account and it also fails
> when it comes to store preferences.
Hmmm. My PolyClock gadget's working fine for me since I implemented
the workaround (see below). In what browser are you having trouble,
might I ask?
> Also, Dan's suggestion of making default values equals to "" didn't
> work at all.
I agree - that's what I said in the thread where he suggested it.
> Making it equals everything else, prefs always resolve to
> default values.
This isn't my experience, with a number of other gadgets. A non-blank
default value seems to suppress the extra hash parameter that's
causing all the trouble. Can you post a counterexample? It might be
helpful in getting to the bottom of this.
> If you have no clues of workarounds, I think I should code script to
> parse URL itself.
That's what I ended up doing with PolyClock. Here's a function to do
so, if you need one:
function getURLParameter (name)
{
var regex = new RegExp('[;?&]' + name + '=([^&#]*)');
var result = regex.exec(window.location.href);
if (result != null)
result = decodeURIComponent(result[1].replace('+', ' '));
return result;
};
Let us know how you do,
String
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"iGoogle Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Gadgets-API?hl=en
-~----------~----~----~----~------~----~------~--~---