Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsdom.jQueryify() not passing correct directory syntax on Windows node environments #27

Open
iampatgrady opened this issue Apr 2, 2014 · 0 comments

Comments

@iampatgrady
Copy link

The following code in your project does not work on a Windows Node.js environment:

jsdom.jQueryify(window, __dirname + '/../deps/jquery-1.6.1.min.js'), function (win, $) {
    $('head').append($(body).find('head').html());
    $('body').append($(body).find('body').html());
    callback(null, $);
});

Please add require('path'); to the scraper.js file and then make this slight modification to the above code:

jsdom.jQueryify(window, path.join(__dirname , '/../deps/jquery-1.6.1.min.js')), function (win, $) {
    $('head').append($(body).find('head').html());
    $('body').append($(body).find('body').html());
    callback(null, $);
});

With that tiny change the scraper.js works on Windows and *nix environments

sorry, i'm new to GITHUB and GIT in general, otherwise i'd submit the code myself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant