Sunday 15 April 2012

jquery - creating elements - most concise syntax? -


Well, I'm new to coffeescript, but it's literally growing on me and I just got a new project with it . I love how one can be brief and trying to figure out how to prepare HTML elements on the fly in a nutshell. Best I could use CS + Jake:

  div = $ "
", {class: "studio", id: "studio _ # {v [However, for long links, if I want to avoid warning lint (and the length of the line is the one that I stick) I have found it is necessary to wrap it on the first curly brace, then I have a question - is there a way to do this? Good way?

In coffee, I like to do things like this:

  $ "& lt; Div> ", class:" studio "id:" studio _ # {v ['id']} "text:" some text "  

I find it more readable at the end

No comments:

Post a Comment