Created
February 3, 2011 00:59
-
-
Save Kevnz/808847 to your computer and use it in GitHub Desktop.
Using YUI3 within node.js fails for id selector, but not class selector
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 result = fs.readFileSync(filename, "binary"); | |
YUI({loadOptional: true}) | |
.use('nodejs-dom', 'event', 'node', function(Y) { | |
var doc = Y.one('doc'); | |
doc.empty(); | |
doc.append(result); | |
var idSelector = 'div#test-id'; | |
var classSelector = 'div.test-case'; | |
var idContainer = Y.one(idSelector); | |
var classContainer = Y.one(classSelector); | |
if(idContainer === null){ | |
console.log('The ID Selector is null'); | |
} | |
if(classContainer !== null){ | |
console.log('The Class Selector is not null'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment