Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #18634

Re: Convert anonymous function to namned function

From Gregor Kofler <usenet@gregorkofler.com>
Newsgroups comp.lang.javascript
Subject Re: Convert anonymous function to namned function
Date 2013-02-26 10:29 +0100
Organization A noiseless patient Spider
Message-ID <kghv7t$qkc$1@dont-email.me> (permalink)
References <kghtu0$kdo$1@dont-email.me>

Show all headers | View raw


Am 2013-02-26 10:07, schrieb Tony:
> Here I have an anonymous function which is working
> $('#meetings').dblclick(function (e)
>        {
>           //Code to be moved to a named function
>           alert("testing");
>        });
>
> and here I have tried to use a named function called Foo in this way but
> it's not working

Let me guess: You get an alert "when running", then "never again"? Hopeless.

> $('#meetings').dblclick(Foo(e));
> function Foo(e)
>    {
>          alert("testing in Foo");
>    }

$('#meetings').dblclick(Foo);


Gregor

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Convert anonymous function to namned function "Tony" <tony.johansson@inport.com> - 2013-02-26 10:07 +0100
  Re: Convert anonymous function to namned function Gregor Kofler <usenet@gregorkofler.com> - 2013-02-26 10:29 +0100
    Re: Convert anonymous function to namned function "Tony" <tony.johansson@inport.com> - 2013-02-26 10:38 +0100
    Re: Convert anonymous function to namned function "Tony" <tony.johansson@inport.com> - 2013-02-26 10:42 +0100
    Re: Convert anonymous function to namned function Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-26 12:08 +0100

csiph-web