Chris Chabot wrote: > __MODULE_ID__ is replaced by the server with the module id your > application, which can be anything like '1' or 'abcetragg12345345' > (though the former format is more likely then the latter :)
Sorry to be pedantic, but I want to make sure I understand the spec... Would 'abcetragg12345345' really be legal? The gadget spec: http://code.google.com/apis/gadgets/docs/reference/#gadgets.Prefs.getModuleId specifies the 'gadgets.Prefs.getModuleId' method as: String, Number getModuleId() I'm not sure what the "String, Number" bit means. I thought I'd previously read something that said it meant a JavaScript string which is guaranteed to only contain numeric (0-9) characters. But now I can't find that (or any other guidance on this terminology). So maybe I just imagined it. In any case... Can someone clarify what it means? Thanks, Jamey > Basically it's treated like a language tag, which works great inside > of your gadget xml file (since the variable substitution takes place > there) but not in external files (since no var substitution is done on > those), hence this situation that you ran into. > > The solution would be to parse the module id to the external > javascript functions/classes when calling them from the gadget > content, ie something like (assuming draw_tabs is a hypothetical > function in your external js file): > draw_tabs(__MODULE_ID__); > > // in the external js file: > function draw_tabs(myModuleId) > { > alert('drawing tabs using module id: '+myModuleId); > } > > Hope that helps! > > On Wed, Oct 15, 2008 at 7:55 AM, <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > > hi > > what is __MODULE_ID__? > > Specifically I am using __MODULE_ID__ in tab creation as per the > documentation (http://code.google.com/apis/orkut/articles/tabs.html). > But i dont know the meaning. > > If i put tab creation code in xml file then it works fine, > but if i move the same code in external .js file then it gives error > like "__MODULE_ID__ is undefined.". > > Thanks > Amit > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "OpenSocial Application Development" group. To post to this group, send email to opensocial-api@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/opensocial-api?hl=en -~----------~----~----~----~------~----~------~--~---