shindig-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henry Saputra <henry.sapu...@gmail.com>
Subject Re: javascript question
Date Wed, 20 Jul 2011 21:53:44 GMT
HI Derek,

When you said external to gadget, did you mean its loaded from parent
gadget iframe?

- Henry

On Wed, Jul 20, 2011 at 1:55 PM, Derek Houghton <derek@chuwori.co.uk> wrote:
>
> Hi,
> I have a javascript file with nested functions as shown below. It is external to the
gadget.
>
> How can I call the nested function (stg_run) from within the gadget?
>
> from within gadget:
> emouseatlas.emap.RunMe.stg_run(jso);
>
> Thanks
> Derek
>
> //---------------------------------------------------------
> //   Namespace:
> //---------------------------------------------------------
> if(!emouseatlas) {
>   var emouseatlas = {};
> }
> if(!emouseatlas.emap) {
>   emouseatlas.emap = {};
> }
>
>
> //---------------------------------------------------------
> // module for testing from a social gadget
> // encapsulating it in a module to preserve namespace
> //---------------------------------------------------------
> emouseatlas.emap.RunMe = function() {
>        var _debug=true;
>        stg_run =  function(url) {
>
>                //output to firebug
>                if(_debug) {
>                         console.log("inner scope stg_run %s",url);
>                }
>        };//end stg_run
> }();//end RunMe
>
>

Mime
View raw message