mardi 21 avril 2015

Migrate from jsdom to phantom JS ? (basic DOM creation)

Vote count: 1

M. Bostock pointed out that nodejs' jsdom have incomplete support for svg, and, critical for me, doesn't support getBBox(). Also, he advised to switch to nodejs' PhantomJS.

My nodejs + jsdom script create a virtual DOM, with which my d3js plays and is as follow :

var jsdom = require('jsdom');
jsdom.env(
  "<html><body></body></html>",        // CREATE DOM HOOK,
  [ 'http://ift.tt/JmLP3T',    // JS DEPENDENCIES online ...
  '../js/d3.v3.min.js',                // ... & local
  '../js/jquery-2.1.3.min.js'],

  function (err, window) {
           //my normal JS code here !
  }
);

How to migrate nodejs + jsdom into nodejs + PhantomJS ?

asked 1 min ago
Hugolpz
3,248



Migrate from jsdom to phantom JS ? (basic DOM creation)

Aucun commentaire:

Enregistrer un commentaire