fixed factor.html/factor.js to work in Chrome