Testing javascript in webpages So, the problem we are always facing.. How do we test javascript? and user interface javascript at that? In this new re-write we use PhantomJS, a headless WebKit, to provide us access to a propper DOM etc. Give me the gist of it Well, we provide a simple perl-function to run a javascript file against a content-string. That way, so long as you can get the content in a