Error with javascript in firefox
问题 I have a problem with JavaScript running in Firefox. The script below runs without a problem in other browsers except Firefox. var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for(var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[i]] = hash[1]; } if (vars[0] != ' ') { document.all['companyURL'].innerHTML = vars[0]; document.getElementById('domain').value = vars[0]; } So this code runs