有哪些短小卻使人驚歎的 JavaScript 代碼

以前在知乎上面看到的一些極其有意思的短小精悍的js代碼,在這裏作個記錄: 一、JavaScript 錯誤處理的方式的正常姿式。javascript try{ something}catch(e){ window.location.href="http://stackoverflow.com/search?q=[js]+"+e.message;} html 二、單行寫一個評級組件:"★★★★★☆☆☆
相關文章
相關標籤/搜索