FMI, must one include the first set of parentheses to create a
closure?
An old book I was reading said that it's just extra sugar.
function(){
...stuff...
}();
Is just the same. They say.
-chase
On Aug 2, 6:09 pm, Fábio M. Costa wrote:
> It creates a closure, so the variables you create ins
It creates a closure, so the variables you create inside it wont be global
variables. It's basically to avoid creating global variables cause maybe you
can overwrite something you had before and stuff like that. It's safer.
--
Fábio Miranda Costa
On Mon, Aug 2, 2010 at 11:00 AM, Sid-ahmed D wro
Perfect, it's working now.
Thank you.
just to understand.
What does the parentheses in your example ? reduced to a function?
( fu)();
On 2 août, 15:48, Fábio M. Costa wrote:
> Yes you can, look:
>
> http://jsfiddle.net/6UqAP/10/
>
> @Dimitar Christoff:
>
> You can create a request at each
Yes you can, look:
http://jsfiddle.net/6UqAP/10/
@Dimitar Christoff:
You can create a request at each click but its not the correct way. This way
you are being inefficient by creating a request at each click.
You dont need to create a request object at each click, just send a request.
You can
Fabio's example might be bit easier to read, since everything happens
inside the closure. In Barry's example, `clickMore` will be the return
value of the closure (outer function) that is executed there. So say:
var clickMore = (function(){
return function(){ alert('hai'); }
})();
The outer fu
I can not put a variable "url" in this configuration.
Could you please help me ?
http://jsfiddle.net/KzMDG/1/
Thank
On 2 août, 11:17, Dimitar Christoff wrote:
> > You should never create the request object inside the click event.
>
> and why not if you don't plan on recycling it?
>
> Best regar
I can not put a variable "url" in this configuration.
Could you please help me ?
http://jsfiddle.net/KzMDG/1/
Thank
On 2 août, 11:33, Sid-ahmed D wrote:
> Thank you for all your reply.
>
> On 2 août, 11:17, Dimitar Christoff wrote:
>
> > > You should never create the request object inside the
thx Aaron,
thats it ...
i'am happy to have this professional guys here!
On 28 Jul., 19:46, Aaron Newton wrote:
> 1)
>
> el.textEl = el.getElement('.ratingText');
>
> Storing properties directly on elements is a very bad practice. Use element
> storage (el.store('property', value)).
>
> 2) when I
Thank you for all your reply.
On 2 août, 11:17, Dimitar Christoff wrote:
> > You should never create the request object inside the click event.
>
> and why not if you don't plan on recycling it?
>
> Best regards,
> --
> Dimitar Christoff
> blog:http://fragged.org/twitter:http://twitter.com/D_mit
> You should never create the request object inside the click event.
and why not if you don't plan on recycling it?
Best regards,
--
Dimitar Christoff
blog: http://fragged.org/ twitter: http://twitter.com/D_mitar
10 matches
Mail list logo