npm-dom / domquery

jQuery-like handy DOM manipulation library composed from small modules in NPM.
http://npm.im/domquery
83 stars 8 forks source link

How to I access a specific html file? #7

Open chubaka opened 8 years ago

chubaka commented 8 years ago

Hi, now that have installed domquery, how do I tell it to access a specific html ( or handlebars) file in my app? How does it know which file it is manipulating the dom for?

TehShrike commented 8 years ago

You can use domquery to insert html (in the form of a string) into the DOM: https://github.com/npm-dom/domquery#adding-and-removing-elements

If you need to load the html from a server, you'll need to use XHR to do that outside of domquery.

domquery is not for manipulating html strings - if you're running node.js, you probably want cheerio.

If you need a templating engine to take your html/mustache files and put them in the DOM, I would recommend Ractive.