Created
August 29, 2011 12:39
-
-
Save hakobera/1178303 to your computer and use it in GitHub Desktop.
Using jQuery Template in node.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var jsdom = require('jsdom'); | |
jsdom.env({ | |
html: "<html><body></body></html>", | |
scripts: [ | |
'http://code.jquery.com/jquery-1.6.2.min.js', | |
'http://ajax.aspnetcdn.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js' | |
] | |
}, function (err, window) { | |
var $ = window.jQuery; | |
var t = $.tmpl('<div>${message}</div>', { message: 'Hello World' }); | |
console.log(t.text()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment