Addings scripts to jsdom.env() seems not to run callback.
(function() {
var jsdom;
jsdom = require('jsdom');
jsdom.env({
html: "<html><head></head><body><p>ciao</p></body></html>",
done: function(errors, window) {
return console.log(window.location.href);
}
});
}).call(this);
seems to run fine, while
(function() {
var jsdom;
jsdom = require('jsdom');
jsdom.env({
html: "<html><head></head><body><p>ciao</p></body></html>",
scripts: ['https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js'],
done: function(errors, window) {
return console.log(window.location.href);
}
});
}).call(this);
doesn't do anything. It just gives no output.
Using node 0.4.10, jsdom 0.2.1
can you try console.log('here')? it is possible that window.location.href is an empty string?
Unfortunately nothing happens :(
(function() {
var jsdom;
jsdom = require('jsdom');
jsdom.env({
html: "<html><head></head><body><p>ciao</p></body></html>",
scripts: ['https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js'],
done: function(errors, window) {
return console.log('hi mom');
}
});
}).call(this);
looks like jsdom is not compatible with jquery 1.6.2 -- errors would be nice in this case. thank you for reporting this
It looks like this was an issue with fetching things over https. I tested out other scripts over https and got the same thing, but they worked over http. I think my pull request should fix this (https://github.com/tmpvar/jsdom/pull/283).
landed 9565feb7829823d846ed7164e4494e0936a94945