Writing HTML layout/template within javascript bookmarklet -


i have bookmarklet creates ui user interact with. currently, have been using $('<element>').addclass().css({..});, becomes hard maintain. there better way this?

i have tried doing like

var html = "<div class='someclass'>"; html += "<more html/>"; html += "</div>" 

which incredibly hard maintain. there way can write html within javascript, or library jade can use within javascript bookmarklet?

yes, there domain specific language implementation in javascript allow write more expressive html in javascript called pithy.

please remember writing large amounts in pithy maybe not idea , rather want use proper client side templating engine such dustjs or many others.


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -