Closed johnloringpollard closed 7 years ago
Array.prototype.forEach is not in ES5 which is the latest revision PhantomJS 2.1.1 supports. You either need to write ES5 compatible code, transpile, or polyfill missing methods to be able to run on PhantomJS 2.1.1
Oh and since you're actually writing in coffeescript you don't need to use a traditional for loop - just use comprehensions
console.log "Test" for input in document.querySelectorAll('input')
I thought it might have been that. Sorry, I should have done more research. Thanks for the improvement on the for loop. I appreciate it!
@johnloringpollard Whenever PhantomJS 2.5 is released, there is a beta of it available but it has a few issues currently.
I have a page with a forEach javascript loop that works in chrome/firefox but not in my tests. I am not using jQuery. I have to do the old traditional for loop in order to get this to work. I should be able to do a forEach loop right?
phantomjs 2.1.1
coffescript file
output from test