Loading ...
Sorry, an error occurred while loading the content.

Re: [jslint] Formatting of chained functions gives odd results...

Expand Messages
  • Michael Lorton
    It s not completely original -- I got the idea from a little-used area of MochiKit -- but I would like to publicize it. If anyone can suggest an easy way to
    Message 1 of 6 , Mar 31, 2010
    View Source
    • 0 Attachment
      It's not completely original -- I got the idea from a little-used area of MochiKit -- but I would like to publicize it. If anyone can suggest an easy way to tell a lot of people, hey, here's a really easy way to do something you really have to do a lot, I'm open to suggestions.

      M.





      ________________________________
      From: Dave <david.hampton@...>
      To: jslint_com@yahoogroups.com
      Sent: Tue, March 30, 2010 1:52:31 PM
      Subject: Re: [jslint] Formatting of chained functions gives odd results...

      Very Clever Mr. Lorton. I like that very much.

      Dave

      --- In jslint_com@yahoogroups.com, Michael Lorton <mlorton@...> wrote:
      >
      > This is off-topic -- way, way off-topic -- but the jQuery way of generating DOM nodes from strings (or a mixture of strings and function calls) always struck me as smelly. I wrote a bunch of functions that happen to have the same name as DOM nodes to do the generation instead;
      >
      > dom = DIV(DIV({
      > 'id': content_id,
      > 'class': 'content',
      > style : { width : '100px', height : "200px" },
      > DIV({
      > 'id': results_id,
      > 'class': 'results'}),
      > DIV({
      > 'id': sponsored_id,
      > 'class': 'sponsored'})),
      > DIV({
      > 'id': right_sponsored_id,
      > 'class': 'right_sponsored'
      > },
      > UL({
      > 'id': pager_id,
      > 'class': 'pager'
      > })));
      >
      > I find it much easier to read -- plus it's possible to get non-programmer designer types to write the code too, because it is so similar to HTML.
      >
      > You can find the source here: http://www.circuspop.com/static/js/domination.js
      >
      > We now return you to your regularly scheduled JSLint.
      >
      > M.
      >




      ------------------------------------

      Yahoo! Groups Links



      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.