Hi ColinFine,
It doesn't seem to me that these imply that there will be a different
scope, but I'm not sure.
I translate badlly my though (and I'm probably wrong). The created
function in both case have the same scope (I think too).
According to what you quote, I made the following test:
var
Hi again ColinFine,
Just had another test that make me understand what you quote:
var _f=function(){return true};
var F;
if(_f()===true) F=function(){alert('F true');}
else F=function(){alert('F false');};
F();
var _ff=true;
if((function(){return false})()===true) { function FF(){alert('FF
Hi David,
Could you please point me out where it is written, I've perhaps miss
something.
It's cleverly hidden on the docs for Ajax.Updater:
http://prototypejs.org/api/ajax/updater
A better place would (obviously) be on String#evalScripts, which
someone helpfullly pointed out by opening a
On May 24, 3:24 pm, Michael mich...@michaelminella.com wrote:
However, in all of my scenarios, I've declared
functions like this:
var myFunction = function myFunction() {alert('hi');}
and the calls to myFunction work just fine. My question is...why does
my way work? According to the
@TJ,
thanks for the links, as you say, it's cleverly hidden. Perhaps I'm
not enough curious !!
@ColinFine,
According to Flanagan's book (section 8.1.2) the optional function-
name in a function literal is not assigned to a variable, but
apparently lives in a special namespace of its own that
On May 26, 12:41 pm, david david.brill...@gmail.com wrote:
@ColinFine,
According to Flanagan's book (section 8.1.2) the optional function-
name in a function literal is not assigned to a variable, but
apparently lives in a special namespace of its own that allows the
function to
Hi Mickael,
I just look at the prototype documentation, and did not find any note
about:
According to the Prototype documentation, you need to declare the
function and assign it to a global variable:
myFunction = function() {alert('hi');}
Could you please point me out where it is written,
On May 24, 10:24 am, Michael mich...@michaelminella.com wrote:
I understand how Prototype works with regards to the removal of
script tags after evaling the results of an Ajax request. However,
I was doing some research and am now starting to wonder why the way I
declare functions works.