Hi, On Thursday 10 December 2009, meik michalke wrote: > > Another small hint: To append to the end of an array in JS, you can also > > write: > > array_variable.push (new_element); > > actually i knew that, too, but was focussed on the functionality. would you > prefer the use of push instead of length? i didn't think much about it but > simply took the alternative that seemed to be more backwards compatible, > but surely we don't have to care about earlier JS implementations.
personally, I would have used push(). You're right that there's no need to worry about backwards compatibilty at this point. But we don't need a policy for everything. Your code is perfectly fine as is, I just thought you might not be aware of the alternative. While we're at it, though, here's another small nitpick (unrelated to JS): Instead of rk.print ("<h2>Something</h2>") please use rk.header ("Something", level=2) Similarly, to output fixed-width, non-breaking text, we have rk.print.literal(). In case we ever want to switch to a different output format, this will make things a lot easier. (And even if we stick with HTML, forever, we might want to augment some things with styles, classes, tables of content, or whatnot). Note that the ability to specify a certain level in rk.header() is new in RKWard 0.5.2, so your solution really used to be the only way to do this. But whenever we start with the conversion to JS for real, it probably makes sense to keep an eye on these things, as well. Regards Thomas
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------------ Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev
_______________________________________________ RKWard-devel mailing list RKWard-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rkward-devel