2 messages in com.googlegroups.google-gadgets-apiRe: __MODULE_ID__ -> content type URL
FromSent OnAttachments
John15 Dec 2006 08:23 
Justin McConnell15 Dec 2006 14:28 
Subject:Re: __MODULE_ID__ -> content type URL
From:Justin McConnell (bool@gmail.com)
Date:12/15/2006 02:28:46 PM
List:com.googlegroups.google-gadgets-api

On Dec 15, 8:24 am, "John" <yspl@gmail.com> wrote:

Can I even use this variable (__MODULE_ID__) if my gadget is of content type 'URL'?

Nope. As you can see it doesn't work. Now, since URL gadgets run in iframes, you don't have to worry about your gadget's namespace overlapping with another. HTML element IDs and Javascript function/variable names are never going to conflict with one another. But if you need it for another reason its pretty easy to get.

I'm trying to reference this and I'm getting a javascript error telling me that this variable is not defined...

When the gadget loads the URL you specify, it sends along (among other things) the module id in the query string. You can use the server side script of your choice to parse it out (the mid key). Here is a sample URL where the module id is 13: http://www.talisweb.com/justin/gmodules/test.pl?lang=en&country=us&.lang=en&.country=us&synd=ig&mid=13&parent=http://www.google.com&&libs=U4zVTYXvbF0/lib/libcore.js

The following part of the API guide gives a more detailed example: http://www.google.com/apis/gadgets/fundamentals.html#URL