[Proto-Scripty] Re: how to update a function with a remote call

2010-09-22 Thread T.J. Crowder
equest/ http://proto-scripty.wikidot.com/prototype:how-to-bulletproof-ajax-requests HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Sep 22, 7:22 pm, nephish wrote: > I am working with a javascript function called Elabel, part of the > Google m

[Proto-Scripty] Re: how to update a function with a remote call

2010-09-24 Thread T.J. Crowder
er argument list  in this line > onSuccess: function(response) { > > i have tried lots of different adjustments. > > thanks > sk > > On Sep 22, 4:53 pm, "T.J. Crowder" wrote: > > > > > Hi, > > > You're taking the return value of `new Aja

[Proto-Scripty] Re: Variables in $$() ?????

2010-09-25 Thread T.J. Crowder
ere passing the string "input[type=radio][name='type'][value=selectThis]" into $$ as the selector. David's suggestion fixes that by using the *value* of selectThis rather the actual text "selectThis". As the live example above shows, that works. FWIW, -- T.J. Crow

[Proto-Scripty] Re: Variables in $$() ?????

2010-09-25 Thread T.J. Crowder
g}'); >   var selectThis; >   var selectID; > >   selectID = {matchID: strID}; >   selectThis = {matchString: strValue }; >   $$('select#selectIDTemplate.evaluate(selectID) option').each(function(o){ >     if(o.value == selectTemplate.evaluate(selectThis)){o

[Proto-Scripty] Re: jquery galleria and prototype

2010-09-25 Thread T.J. Crowder
Hi, This is probably more of a question for the jQuery forums, or the makers of the galleria plugin you're using. My suspicion is that the plug-in doesn't support jQuery's noConflict mode (that's easy to do). FWIW, -- T.J. Crowder Independent Software Engineer tj / crowder so

[Proto-Scripty] Re: Named functions on IE

2010-09-27 Thread T.J. Crowder
whether it closes over data. More about closures here: http://blog.niftysnippets.org/2008/02/closures-are-not-complicated.html HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Sep 27, 3:01 am, Daniel Ribeiro wrote: > The author

[Proto-Scripty] Re: Trouble in IE8

2010-09-28 Thread T.J. Crowder
Hi, Can you put together a minimalist, self-contained example and post it to pastie.org or jsbin.com or jsfiddle.net or somewhere? Just the minimum needed to show the problem. -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Sep 28, 4:03

[Proto-Scripty] Re: Trouble in IE8

2010-09-28 Thread T.J. Crowder
http:// URLs, loading Prototype from the Google CDN: http://jsbin.com/itovi4 As you can see, the returned result is extended (it has Prototype's `observe` function on it). HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Sep 28, 2:56

[Proto-Scripty] Re: IE read attribute issue for 'href'.

2010-10-03 Thread T.J. Crowder
DOM-Level-2-HTML/html.html#ID-88517319 HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Oct 2, 6:39 pm, Vinoth John wrote: > Div tags generated from template's href value , when it is tried to be > retrieved through read a

[Proto-Scripty] Re: Protosafe

2010-10-04 Thread T.J. Crowder
Hi, Protosafe is no longer being maintained by its original maintainer (or anyone else, as far as I know). It's an ex-project. ;-) HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Oct 3, 8:14 pm, nono1974 wrote: > Hi all

[Proto-Scripty] Re: IE read attribute issue for 'href'.

2010-10-04 Thread T.J. Crowder
file , i hav sent you in this mail. It will clearly tell you the issue i > am facing. Thanks for your response in advance.   > > Thanks & Regards, > Vinoth john > > > >  -Original Message- > From: T.J. Crowder > Sent:  03/10/2010, 7:14  PM > To: Prototype & sc

[Proto-Scripty] Re: Protosafe

2010-10-05 Thread T.J. Crowder
e Prototype and MooTools on the same page is likely to be a painful effort and would recommend picking one and just using it. There's a lot of overlap. HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Oct 4, 8:26 pm, nono1974 wrot

[Proto-Scripty] Re: Microsoft announced new useful plugins on JQuery - what about prototype?

2010-10-05 Thread T.J. Crowder
iting), but the _fact_ of them coming on the heels of Microsoft's recently re-upping their commitment to jQuery is significant. -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Oct 5, 3:52 pm, buda wrote: > jQuery is developing very qu

[Proto-Scripty] Re: Microsoft announced new useful plugins on JQuery - what about prototype?

2010-10-06 Thread T.J. Crowder
Tobie, > You'll be happy to notice that thanks to the work I did a couple of > weeks ago[1], the globalization plugin is also available _from the > same repo_ without any dependency on jQuery[2]. Props, man! Nice one. -- T.J. :-) On Oct 6, 3:37 pm, Tobie Langel wrote: > Hey folks. > > You'll b

[Proto-Scripty] Re: weird issue with .each and objects

2010-10-10 Thread T.J. Crowder
the horror that is JavaScript's implicit globals[1], which I would STRONGLY recommend against doing. [1] http://blog.niftysnippets.org/2008/03/horror-of-implicit-globals.html HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Oct 10, 4:25 a

[Proto-Scripty] Re: Prototype.js Memory Leaks

2010-10-12 Thread T.J. Crowder
'click' event of the element. You can be more general and remove all click handlers from the element: $('foo').down('div.watchme').stopObserving('click'); ...or even _more_ general and remove all handlers from all events on the element: $('foo

[Proto-Scripty] Re: Prototype.js Memory Leaks

2010-10-12 Thread T.J. Crowder
Hi again, I probably should have mentioned in my earlier message that Prototype 1.7 (which hasn't been released yet) has built-in delegation handling which can make the `findElement` stuff a bit shorter syntactically: $('foo').on('click', 'div.watchme', clickHandlerFunction); See http://api.

[Proto-Scripty] Re: Ajax.PeriodicalUpdater not working in IE

2010-10-13 Thread T.J. Crowder
Hi, You might check out 1.7RC3, it has IE9 support: http://prototypejs.org/2010/10/12/prototype-1-7-rc3-support-for-ie9 HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Oct 9, 7:57 am, asb wrote: > Hello, > > Ajax.Periodic

[Proto-Scripty] Re: Ajax.PeriodicalUpdater not working in IE

2010-10-13 Thread T.J. Crowder
rototype enhancment on an un-enhanced DOM element; details: http://prototypejs.org/learn/extensions HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Oct 13, 11:43 am, AshishSingh Bhatia wrote: > Hello , > > I have an applicat

[Proto-Scripty] Re: Stack overflow... ???

2010-10-14 Thread T.J. Crowder
: http://jsbin.com/aboyo/2 You can condense that a bit: http://jsbin.com/aboyo/3 HTH, apologies if I've gotten the wrong end of the stick. -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Oct 14, 1:54 am, Phil Petree wrote: > Hey

[Proto-Scripty] Re: Stack overflow... ???

2010-10-14 Thread T.J. Crowder
ucks!  It should have been a 2 minute find/do. > > Not gonna worry about the click handler because there are only 8 onclicks on > that page and I doubt a user will use more than 1 or 2 of them... if they > even realize those images work that way... just an easter egg is all it is. > &

[Proto-Scripty] Re: Does .up() work in IE 9?

2010-10-15 Thread T.J. Crowder
Hi, Are you using 1.7RC3? It has IE9-related fixes. http://prototypejs.org/2010/10/12/prototype-1-7-rc3-support-for-ie9 HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Oct 14, 9:51 pm, Benxamin wrote: > I inherited on some tab

[Proto-Scripty] Re: delayed show/hide does not work in IE7

2010-10-15 Thread T.J. Crowder
s.org/2008/03/mythical-methods.html http://blog.niftysnippets.org/2008/04/you-must-remember-this.html HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Oct 15, 8:30 am, Tobie Langel wrote: > Or: > > var element = $('so

[Proto-Scripty] Re: Stack overflow... ???

2010-10-17 Thread T.J. Crowder
ot;data-picker" is a real > attribute?? or you just add it for easy use with the $('*[data- > picker]') selector?? > > thanks in advance > nahum > > On Oct 14, 10:35 am, "T.J. Crowder" wrote: > > > > > Hi, > > > > Thanks

[Proto-Scripty] Re: Scalable Drag & Drop (without noticeable lag)

2010-10-17 Thread T.J. Crowder
rstood the truly bizarre and arbitrary way Google adds linebreaks to code...) FWIW, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Oct 15, 7:08 pm, Scott wrote: > When copying and pasting the html from my post, there are some ext

[Proto-Scripty] Re: Prototype Incompatible with IE 8.0

2010-10-18 Thread T.J. Crowder
operties and applies them to a destination object. There's nothing tricky about it at all. The only issue I could see would be if you tried to use it on a host-provided destination object that doesn't allow custom properties. FWIW, -- T.J. Crowder Independent Software Engineer tj / crowde

[Proto-Scripty] Re: declare element in class

2010-10-19 Thread T.J. Crowder
Hi, The problem isn't in the declaration of the properties, it's in how you're calling the `show` function. You're calling it without ensuring that `this` has the correct value. Details and solution here: http://blog.niftysnippets.org/2008/04/you-must-remember-this.html

[Proto-Scripty] Re: Expando or "data-" like attributes?

2010-10-20 Thread T.J. Crowder
a selector. This is just to cut out the overhead of reading and writing attributes to the underlying DOM, and because properties can be things other than strings. In practice, I find I have virtually no use for expando properties in my applications (I use elements to *represent* application object

[Proto-Scripty] Re: Expando or "data-" like attributes?

2010-10-20 Thread T.J. Crowder
ot so bad > practice? On Oct 20, 1:48 pm, buda wrote: > T.J.,  thanks for an exhaustive explanation! > But, as I understud, expando properties == custom attributes and its > not good, but I see expando on extended elements in prototype! > Will this to migrate to storage functionality o

[Proto-Scripty] Re: clear prototype hash

2010-10-20 Thread T.J. Crowder
od idea, but it seems like an odd omission to me. I've done a ticket in Lighthouse[1] offering to do a patch on git (for 1.7.1, not 1.7.0) if people do want it. [1] https://prototype.lighthouseapp.com/projects/8886-prototype/tickets/1158-add-hashclear FWIW, -- T.J. Crowder Independent S

[Proto-Scripty] Re: clear prototype hash

2010-10-21 Thread T.J. Crowder
Hi, > I'm surprised the loop didn't work, it seems to: > http://jsbin.com/ejeju4/2 Sorry, that link was wrong. It should be: http://jsbin.com/ejeju4 -- T.J. On Oct 21, 7:51 am, "T.J. Crowder" wrote: > Hi, > > On Oct 21, 3:39 am, chrysanthe m wrote: > &g

[Proto-Scripty] Re: clear prototype hash

2010-10-21 Thread T.J. Crowder
wn" -- but I assume that that's just a typo in this message, or you'd be seeing an exception in your debugger.) With these things, sometimes the issues become obvious when you step through the code with a debugger. Might have helped here, if you did that and saw the values fo

[Proto-Scripty] Re: mousedown observer cancels button click?

2010-10-21 Thread T.J. Crowder
lick but *will* trigger `mouseup` -- like pressing down elsewhere, the moving the mouse onto the button and releasing the mouse button. Let's defer to the UA about when the user's actually clicked the button.) HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / co

[Proto-Scripty] Re: Anchor button triggers window.onbeforeunload in IE

2010-10-22 Thread T.J. Crowder
nt/observe/ [2] http://api.prototypejs.org/dom/event/ [3] http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-Event-preventDefault [4] http://api.prototypejs.org/dom/event/stop/ HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On O

[Proto-Scripty] Re: Deleting a class object releasing the memory.

2010-10-22 Thread T.J. Crowder
` object. Here are the test files: http://pastie.org/1240577 - the basic counter test http://pastie.org/1240579 - keep the instances test http://pastie.org/1240582 - don't null out array entries test http://pastie.org/1240613 - using the one-liner `destroy` above HTH, -- T.J. Crowder Indepen

[Proto-Scripty] Re: Deleting a class object releasing the memory.

2010-10-22 Thread T.J. Crowder
have to audit the code, ensure there are no circular references anywhere (which _will_ cause memory leaks), make sure you don't have references being kept active by closures (you don't in your example code, but as we've said, that was just test code), etc. [1] http://en.wikipedi

[Proto-Scripty] Re: mousedown observer cancels button click?

2010-10-22 Thread T.J. Crowder
ee Davis wrote: > On Oct 21, 2010, at 6:32 PM, T.J. Crowder wrote: > > > Instead, I'd do it in the obvious place: The form submit event: > >http://jsbin.com/aniro4/3Or you could do it on the `click` event of > > the button:http://jsbin.com/aniro4/4(I wouldn't use

[Proto-Scripty] Re: Deleting a class object releasing the memory.

2010-10-25 Thread T.J. Crowder
s programhttp://home.orange.nl/jsrosman/to see the > memory and the DOM elements used and you'll see how after the destroy > 1 node is released, the node for the "testDiv" variable. > > So, why is deleting this variable and not the array? it sounds very > strange

[Proto-Scripty] Re: Anchor button triggers window.onbeforeunload in IE

2010-10-25 Thread T.J. Crowder
ccording to the spec, and I know it does for other things, but I think some significant implementation has an issue with generating the call without clarifying it as with the parens above. Happy coding, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software

[Proto-Scripty] Re: Anchor button triggers window.onbeforeunload in IE

2010-10-25 Thread T.J. Crowder
owStatMsgAndStopHandler` in a place you're defining other generally-useful stuff, the only closures in the rewrite are generated in the well-controlled scope of Function#curry. So we're not keeping stuff in memory we don't need. [1] http://blog.niftysnippets.org/2010/03/anonymous

[Proto-Scripty] Re: Deleting a class object releasing the memory.

2010-10-25 Thread T.J. Crowder
Hi, > Do you have any idea why is this happening? Well, assuming it _is_ actually happening as opposed to being a measurement error, I'm afraid not. The thing (again) that I'm not sure Jose was really clear on was that memory will NOT be freed immediately just because you stopped referencing it,

[Proto-Scripty] Re: transfert parameter (this) in Ajax.Request

2010-11-01 Thread T.J. Crowder
More here: http://blog.niftysnippets.org/2008/04/you-must-remember-this.html http://api.prototypejs.org/language/function/prototype/bind/ HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Nov 1, 8:14 pm, laurent barre wrote: > Hi, >

[Proto-Scripty] Re: transfert parameter (this) in Ajax.Request

2010-11-03 Thread T.J. Crowder
p your page, but every page in every tab. (And most of the others aren't much better, partially because they basically *can't* be -- if you have any other JavaScript on the page, they *have* to completely lock it up during a synchronous request.) It's a Bad Thing(tm), hence my not tal

[Proto-Scripty] Re: Form.serialize without empty inputs.

2010-11-07 Thread T.J. Crowder
"): "Properties of the object being enumerated may be deleted during enumeration." [1] http://www.ecma-international.org/publications/standards/Ecma-262.htm HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Nov 5, 9:

[Proto-Scripty] Re: Prototype & script.aculo.us and conflict

2010-11-07 Thread T.J. Crowder
the authors of the other software to fix their `for..in` loops, because Prototype adds a lot of functions to the `Array.prototype` and that's why you're seeing functions in the result. (Again, details in the link above.) HTH, -- T.J. Crowder Independent Software Engineer tj / crowder sof

[Proto-Scripty] Re: the working of Template.evaluate

2010-11-07 Thread T.J. Crowder
firstname: "Joe", lastname: "Bloggs" }); (Example: http://jsbin.com/axuzo3) The regex plus the loop are what make that happen, both the subscript notation (the first one) and the dotted notation (the second one). I think it only works one level deep with the bracketed

[Proto-Scripty] Re: hash.__properties is undefined

2010-11-07 Thread T.J. Crowder
sh` object (instead of its published API), I'm afraid you'll have to rewrite it to use the API instead (as internals can change from a dot rev to a dot rev without notice). FWIW, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Nov 7, 8:10

[Proto-Scripty] Re: ajax request no works on Chrome - decoding fails

2010-11-08 Thread T.J. Crowder
value just as you would any other value: $request = $_POST["json"]; $requestObject = Zend_Json::decode($request); // Or your $zendJson, whatever that is But again, I'm not a PHP guy and could easily be missing something important here. FWIW, -- T.J. Crowder Indepe

[Proto-Scripty] Re: ajax request no works on Chrome - decoding fails

2010-11-08 Thread T.J. Crowder
/Global_Objects/encodeURI https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/encodeURIComponent HTH, -- T.J. :-) On Nov 8, 9:42 pm, "T.J. Crowder" wrote: > Hi, > > I don't know that it's the problem because I'm not a PHP person, but > you're

[Proto-Scripty] Re: ajax request no works on Chrome - decoding fails

2010-11-09 Thread T.J. Crowder
: > > > > > > > > > Right. The best low-level way to translate JS to PHP and back again is   > > using encodeURI or uncodeURIComponent on your JS side, and   > > rawurldecode() or rawurlencode() on the PHP side. They are   > > functionally identical, as long

[Proto-Scripty] Re: ajax request no works on Chrome - decoding fails

2010-11-10 Thread T.J. Crowder
up to you). This is what I've suggested that you haven't, as far as I can tell, tried: On Nov 8, 9:42 pm, "T.J. Crowder" wrote: > > The most reliable way to send parameters that I know is to send them > URL-encoded, and to decode them as URL-encoded data. In Prototy

[Proto-Scripty] Re: ajax request no works on Chrome - decoding fails

2010-11-11 Thread T.J. Crowder
Hi, It's T.J., not J. > i want convert requestObject in JSON string and send to the server. > >  var jsonRequest         = > encodeURIComponent(JSON.stringify(requestObject)); > new Ajax.Request(baseUrl + '/usermsg/index/sendmessage', { >             method:     'POST', >             requestHeade

[Proto-Scripty] Re: Prototype 1.7rc3 bug with Chrome sending ajax request twice and Opera even 3 times

2010-11-11 Thread T.J. Crowder
Can you post a complete, self-contained, minimalist test page[1] (perhaps to Pastie.org or even JSBin.com) demonstrating the problem? [1] http://proto-scripty.wikidot.com/self-contained-test-page -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software

Re: Risky delay (was: Re: [Proto-Scripty] Re: Prototype / IE6 issue (bug?))

2010-11-18 Thread T.J. Crowder
Hi, > In the case of ie6, with less than 5% of all page views (and rapidly > declining), it is now a footnote so why support it at all? > > stats here:http://mashable.com/2010/06/01/ie6-below-5-percent/ As is frequently the case, it's more complicated than that. :-) StatCounter may say less than

[Proto-Scripty] Re: Extending a DOM-Object

2010-11-21 Thread T.J. Crowder
the DOM and JavaScript layers can cause memory leaks on IE. [1] http://msdn.microsoft.com/en-us/library/ms533747(VS.85).aspx [2] http://prototypejs.org/learn/extensions Happy coding, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Nov 21

[Proto-Scripty] Re: Do somthing only after two Ajax calls return results

2010-11-22 Thread T.J. Crowder
threaded unless you explicitly // use the web workers stuff, which we aren't. callback(); } } } [1] http://www.stevesouders.com/blog/2008/03/20/roundup-on-parallel-connections/ HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www

[Proto-Scripty] Re: Ajax.Updater & HTML Entities

2010-11-24 Thread T.J. Crowder
in this updated example[2]. Also worth using a tool like Firebug or Chrome's Dev Tools, etc., to look at the HTTP response. Is it being served with the right content type? (Although I'm not sure how much Ajax.Updater cares.) [1] http://jsbin.com/ukasi3/2 [2] http://jsbin.com/ukasi3/3 HTH,

[Proto-Scripty] Re: Google Compiler warnings: dangerous use of the global this object

2010-11-26 Thread T.J. Crowder
fficient externs, you should be able to compile your _own_ code with advanced optimizations while still using Prototype & script.aculo.us, and you could combine the result into a single file to minimize HTTP requests. FWIW. -- T.J. Crowder Independent Software Engineer tj / crowder softwar

[Proto-Scripty] Re: When does Prototype 1.7 fire Element.Methods.replace (IE)?

2010-11-26 Thread T.J. Crowder
know. Can you give it a try? Sounds like it _may_ be a bug in Prototype in that specific situation, with that specific browser. A simple, standalone test case is the first step to getting that resolved. -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software

[Proto-Scripty] Re: Class Inheritance & Properties

2010-11-29 Thread T.J. Crowder
-supercalls-in.html Happy coding, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Nov 29, 4:45 pm, Luke wrote: > Thanks. Fermion in the Prototype-IRC also told me the same thing. But > he said you cannot access the parent's propert

[Proto-Scripty] Re: Class Inheritance & Properties

2010-11-30 Thread T.J. Crowder
? > > Would that be better to use for performance critical apps instead of the > $super argument? > > On Mon, Nov 29, 2010 at 8:03 PM, T.J. Crowder wrote: > > > > > > > > > Hi, > > > From within a call to `SectionText`'s `extension` function, you

[Proto-Scripty] Re: compatible versions 1.5

2010-11-30 Thread T.J. Crowder
b/master/CHANGELOG [2] https://github.com/madrobby/scriptaculous/blob/master/CHANGELOG HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Nov 30, 4:33 pm, robsan wrote: > Hi my name is Robin and I am developing for a quit big site which is > ru

[Proto-Scripty] Re: addClassName and removeClassName don´t work

2010-12-01 Thread T.J. Crowder
inimalist, self-contained test page demonstrating the problem. 90% of the time (at least), just the process of doing that helps you find the answer; the other 10%, you have something you can post so people can help you out. HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / co

[Proto-Scripty] Re: Ajax.Request bug using IE 7 and Prototype 1.7

2010-12-01 Thread T.J. Crowder
to actually call the `callbackResponse` passed into it (http://jsbin.com/asate3/3), it succeeds in calling that (including on IE7) and then fails (of course) to call the non-existant function callbackResponse_1. Nothing whatsoever to do with XMLHttpRequest. Or Prototype. Am I missing something? -- T.J.

[Proto-Scripty] Re: Ajax.Request bug using IE 7 and Prototype 1.7

2010-12-02 Thread T.J. Crowder
be able to help you. I don't think the fact it's JSP has anything to do with it (unless, of course, the JSP isn't outputting the HTML you expect -- but that's nothing to do with Prototype). > Any other suggestion? Just to create a self-contained example and post it some

[Proto-Scripty] Re: Traverse table cells

2010-12-02 Thread T.J. Crowder
ed in a CSS selector. Strongly recommend sticking to the CSS ID rules when selecting HTML element IDs for elements you're later going to manipulate via a JavaScript library. HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Dec 2,

[Proto-Scripty] Re: Anything wrong with adding a function called 'click' to the global Element-namespace?

2010-12-06 Thread T.J. Crowder
> some form controls (radio, checkbox, maybe others...) have a native > click() method that toggles them, so that would be in conflict... Nice one, *exactly* why this sort of thing is not generally a good idea. Create a utility class to do it, etc., but putting them on the actual elements is askin

[Proto-Scripty] Re: Infinite references

2010-12-09 Thread T.J. Crowder
quot;child" is "children", not "childs". Although most English nouns are made plural by adding an "s" or "es" or even "ses", quite a number of them are done differently.) Hope this helps, -- T.J. Crowder Independent Software Engineer tj / crowd

[Proto-Scripty] Re: Observe once

2010-12-09 Thread T.J. Crowder
od reason to do the function expression (`var discardAll = function`...), use a function declaration instead (`function discardAll`...), as here: http://jsbin.com/awiqi4/2 But it doesn't matter for the problem you've outlined, unless the code is in a different order than shown. FWIW, --

[Proto-Scripty] Re: Extending the "Object"-Class

2010-12-11 Thread T.J. Crowder
ition, it's *possible* to add non-enumerable properties to `Object.prototype` using special syntax, but I still wouldn't do it.) HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Dec 11, 12:07 am, Luke wrote: > H

[Proto-Scripty] Re: Class.create() and Object.clone() and methods

2010-12-17 Thread T.J. Crowder
name: 'a' }; var b = Object.clone(a); b.name = 'b'; a.func(); b.func(); display("a.func === b.func? " + (a.func === b.func)); * * * * http://jsbin.com/abeqe3 HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder softw

[Proto-Scripty] Re: Is there a way to get the name of a class from within the class?

2010-12-17 Thread T.J. Crowder
m instanceof MyCoolClass)); display("m.x = " + m.x); var c = m.clone(); display("c instanceof MyCoolClass? " + (m instanceof MyCoolClass)); display("c.x = " + c.x); * * * * http://jsbin.com/oqoxe5 HTH, -- T.J. Crowder Independent Software Engineer tj / crowder soft

[Proto-Scripty] Re: Is there a way to get the name of a class from within the class?

2010-12-17 Thread T.J. Crowder
y know the answer to certain aspects of the question, but we were all new once, we all have limited time to read things, and we don't all learn perfectly reading general texts; sometimes we need our specific question answered in order to understand a broader concept. -- T.J. Crowder Independent So

[Proto-Scripty] Re: Is there a way to get the name of a class from within the class?

2010-12-17 Thread T.J. Crowder
> with, and stop before it gets extended twice. But I'll think I'll > define the classname as a property in the class itself then, and maybe > throw an error if the classname has not been set. > > On Dec 17, 3:08 pm, "T.J. Crowder" wrote: > > > > > &

[Proto-Scripty] Re: PeriodicalExecuter counter

2010-12-17 Thread T.J. Crowder
forgetting to stop them... FWIW, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Dec 17, 10:20 pm, JoJo wrote: > What's the best way to find which iteration the PeriodicalExecutuer is > currently on? What I'm trying to do is

[Proto-Scripty] Re: Is there a way to DRY this up?

2010-12-23 Thread T.J. Crowder
veAll(['keyup', 'click', 'focus', 'blur'], function(evt) {   this.fire('check:filter'); }); // Or: $('filter').observeAll('keyup click focus blur', function(evt) {   this.fire('check:filter'); }); // Or even: var filter = $(&#

[Proto-Scripty] Re: Observe form submit which button clicked?

2010-12-23 Thread T.J. Crowder
jsbin.com/ukifo3 Works with IE6, IE7, Firefox, Opera, Chrome... FWIW, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Dec 22, 9:51 pm, kstubs wrote: > OK, just observing click event for the submit button is working fine. --

[Proto-Scripty] Re: element.getStyle('border') does not work

2010-12-23 Thread T.J. Crowder
It doesn't seem to be a Prototype-specific thing. `getComputedStyle` is just not giving back that information: http://jsbin.com/uyifa4 Except on Opera. It works on Opera. V. weird. FWIW, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / co

[Proto-Scripty] Re: element.getStyle('border') does not work

2010-12-23 Thread T.J. Crowder
Doh! Not all that weird, I'd forgotten that `border-size` is a shorthand property! Works with full names: http://jsbin.com/uyifa4/2 Nice one, Walter! -- T.J. On Dec 23, 5:45 pm, "T.J. Crowder" wrote: > It doesn't seem to be a Prototype-specific thing. `getComputedStyl

[Proto-Scripty] Re: Observe form submit which button clicked?

2010-12-24 Thread T.J. Crowder
don't have names at all and so are not sent to Google. -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Dec 24, 3:51 am, kstubs wrote: > T.J., Duhh!  Thanks for pointing out the obvious.  I was stuck on observing > "submit

[Proto-Scripty] Re: Passing context

2010-12-24 Thread T.J. Crowder
ut there's no reason to bind the function, you're already effectively doing that in your first example. So the first example is correct, but apparently there's some problem in the surrounding code; you'll have to show us that. [Super-freaky bracing style. :-)] HTH, -- T.J

[Proto-Scripty] Re: Dilemma: singleton or ordinal object?

2010-12-24 Thread T.J. Crowder
nction Singleton_bar() { // ... } return pubs; })(); Usage: Singleton.foo(...); Singleton.bar(...); ...but somehow I don't think that's what you have in mind. FWIW (little, I'm thinking), -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder

[Proto-Scripty] Re: Dilemma: singleton or ordinal object?

2010-12-25 Thread T.J. Crowder
> why do not you like the anonymous function? Because I like to help my tools help me: http://blog.niftysnippets.org/2010/03/anonymouses-anonymous.html -- T.J. :-) On Dec 25, 8:26 pm, buda wrote: > why do not you like the anonymous function? > > On 25 дек, 00:42, "T.J

[Proto-Scripty] Re: Passing context

2010-12-25 Thread T.J. Crowder
Hi, Based on that code, the `this` value in `_msoSGrid.load` definitely refers to `_msoSGrid`. What makes you think the context during the call is wrong? I'd say there's an issue with the actual `load` function, because the call to it is absolutely fine. -- T.J. On Dec 25, 3:00 am, kstubs wrot

[Proto-Scripty] Re: Passing context

2010-12-27 Thread T.J. Crowder
be undefined (because the div doesn't exist yet), that's all that `bindAsEventListener` will see. Your updated code: document.observe( 'MeetQuery:lookup_scores', function(event) { _msoRSess.appear($('SCORES').down('div.grid table')); } ); ...doesn't d

[Proto-Scripty] Re: Encoding parameters in Ajax Request

2011-01-02 Thread T.J. Crowder
What does your actual Ajax.Request code look like? -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Jan 2, 5:40 am, kstubs wrote: > I'm passing a parameter string to parameter: of the Ajax.Request object.  My > string looks like

[Proto-Scripty] Re: Adjust file structure

2011-01-02 Thread T.J. Crowder
I've never had to do the above in the real world. Perhaps someone with real-world experience will chime in, and if they do, they're likely to have higher-quality information. [1] http://developer.yahoo.com/performance/rules.html [2] http://code.google.com/speed/articles/web-metrics.html H

[Proto-Scripty] Re: Encoding parameters in Ajax Request

2011-01-02 Thread T.J. Crowder
er. The string you provide the actual one used. HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Jan 2, 4:09 pm, kstubs wrote: > Hi TJ, I've spent this morning walking through the code and have determined > that p

[Proto-Scripty] Re: Encoding parameters in Ajax Request

2011-01-04 Thread T.J. Crowder
it as "Sr%2016%2b" (which is perfectly correct) rather than using the + instead of %20. (`encodeURIComponent` will give the the %20 version.) The decoded string is the same. Here's my test page: http://pastie.org/1428234 (but without the showparams.jsp it calls, not sure how much it'

[Proto-Scripty] Re: Prototype 1.7 EvalJSON "Error Sintax" on Date Eval

2011-01-08 Thread T.J. Crowder
Hi, > Afaik a JSON-Object (or string) must be wrapped in {}. What you have is an > array (your string's wrapped with [ ]). Try: No, that's fine. Both object and array are valid top-level objects: http://json.org/ -- T.J. Crowder Independent Software Engineer tj / crowder so

[Proto-Scripty] Re: Prototype 1.7 EvalJSON "Error Sintax" on Date Eval

2011-01-08 Thread T.J. Crowder
and uses `eval` under- the-covers. If you're not comfortable with that, you can use `json_parse.js` or `json_parse_state.js`, neither of which uses `eval`. The former is a recursive-descent parser, the latter is a state machine. HTH, -- T.J. Crowder Independent Software Engineer tj / crowder soft

[Proto-Scripty] Re: License link on main page not working

2011-01-11 Thread T.J. Crowder
> The link provided at the > bottom of the main pagehttp://www.prototypejs.org/for the "MIT > (source code)" does not work. Well, that's not good. In any case, you can find the license with the source code: https://github.com/sstephenson/prototype/blob/master/LICE

[Proto-Scripty] Re: help me, about Class.create

2011-01-12 Thread T.J. Crowder
n't, it keeps using its prototype's property (if any). The thing with your `intro` property is that nothing is ever assigned to it, and so no instance had its own `intro` property, and they were all falling back on the one on `Parent.prototype`. All you ever did in the `ChildA` and

[Proto-Scripty] Re: local variables for for() array iteration

2011-01-19 Thread T.J. Crowder
with `A`'s loop. Corrected: function B() { var i; // <== The new bit for(i=0;ihttp://blog.niftysnippets.org/2008/03/horror-of-implicit-globals.html [2] http://blog.niftysnippets.org/2008/03/poor-misunderstood-var.html HTH, -- T.J. Crowder Independent Software Engineer tj / cro

[Proto-Scripty] Re: local variables for for() array iteration

2011-01-19 Thread T.J. Crowder
t to mention the complications around `this`) just to loop through an array. People are free to do that if they like, but it's not remotely necessary and it's certainly not always appropriate. There's nothing wrong with a nice, simple `for` loop. Just my two cents. -- T.J. Crowder I

[Proto-Scripty] Re: Hey

2011-01-23 Thread T.J. Crowder
at will completely lock up the UI of the browser (not just your page, the entire browser) during the time your ajax call is being processed. Locking up the UI for 1-30 seconds is a Bad Thing(tm). :-) [1] http://api.prototypejs.org/ajax/ HTH, -- T.J. Crowder Independent Software Engineer tj / crowde

[Proto-Scripty] Re: Prototype.js Conflict

2011-01-27 Thread T.J. Crowder
Simple Controls Gallery code suggests that it's noConflict-compatible and it doesn't have any `for..in` loops, so if you add `noConflict` after loading jQuery and before loading Prototype, you should be okay. E.g.: jQuery.noConflict(); HTH, -- T.J. Crowder Independent Software E

[Proto-Scripty] Re: find next element in an array?

2011-02-01 Thread T.J. Crowder
list.indexOf(targetElement); if (index >= 0) { ++index; nextElement = list[index >= list.length ? 0 : index]; } Prototype adds `Array#indexOf` to implementations that don't have it natively. [1] http://api.prototypejs.org/language/Array/prototype/indexOf/ HTH, -- T.J. Crowder

[Proto-Scripty] Re: find next element in an array?

2011-02-01 Thread T.J. Crowder
major version aligns with ECMAScript5). It's easily done. :-) HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crowder software / com On Feb 1, 11:51 am, Bertilo Wennergren wrote: > On Tue, Feb 1, 2011 at 12:35, T.J. Crowder wrote: > > (now that `

[Proto-Scripty] Re: Create Option using prototype

2011-02-03 Thread T.J. Crowder
ate(times[i]); yourSelectBox.insert(o); (Live example: http://jsbin.com/usatu4) ...but on IE6 that worked in that the elements were added to the drop-down, but the drop-down's width wasn't recalculated. HTH, -- T.J. Crowder Independent Software Engineer tj / crowder software / com www / crow

<    2   3   4   5   6   7   8   9   10   11   >