use addEventListener hoping this will work on phantomjs/travis