Hi, Yes I found some good info by Mr Crockford and friends a few weeks
ago.
I was looking up some info on advanced AJAX security techniques.
Found these pages:
http://www.webdirections.org/resources/douglas-crockford-ajax-security/
Some interesting presentation slides...
and from there a link
Your problem is that you are making (reasonable but wrong) assumptions
about what 'this' is bound to.
Inside a function (which is the only level of scope that Javascript
has), 'this' is not set, and therefore refers to the global object
(the window) unless you have done something explicit to
Hi Gilbert,
Building on what Colin said, I'd suggest reading up a bit on
JavaScript and this, it's not quite the same as some other languages
you might be familiar with. If you don't already have a good
JavaScript book, I'd recommend JavaScript: The Definitive Guide by
David Flanagan[1][2].
Hi! Thanks T.J and Colin.
So Far So Good!
I stayed with the 'inline method', to save code.
I could Not get the bind() to work within the Ajax.Request though??
I tried it as T.J showed, and several other ways.
Firebug reported different errors.
Suggested method for inline returned (' missing }
Hi,
Your Logger class, as given, will work fine:
var l = new Logger();
l.write(Testing);
l.write(One);
l.write(Two);
l.write(Three);
The result of the above would be that the 'log' array would be:
[Testing, One, Two, Three]
I have had to use the following in my method that updates the
Thanks T.J.
I probably should have been more specific.
I'm actually building a Q and A Captcha, not a Logger. I used that as
an example.
The issue is, I am using proto's Ajax.Request and I'm running that
code within the 'onComplete: function(transport){ callback }' and this
is executing within