[Proto-Scripty] Re: Using this.arrayname to add data to an array not working

2009-04-30 Thread IMBI-Indie-Portal
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

[Proto-Scripty] Re: Using this.arrayname to add data to an array not working

2009-04-28 Thread ColinFine
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

[Proto-Scripty] Re: Using this.arrayname to add data to an array not working

2009-04-28 Thread T.J. Crowder
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].

[Proto-Scripty] Re: Using this.arrayname to add data to an array not working

2009-04-28 Thread IMBI-Indie-Portal
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 }

[Proto-Scripty] Re: Using this.arrayname to add data to an array not working

2009-04-27 Thread T.J. Crowder
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

[Proto-Scripty] Re: Using this.arrayname to add data to an array not working

2009-04-27 Thread IMBI-Indie-Portal
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