真不該直接用 JavaScript...

紅寶鐵軌客
Join to follow...
Follow/Unfollow Writer: 紅寶鐵軌客
By following, you’ll receive notifications when this author publishes new articles.
Don't wait! Sign up to follow this writer.
WriterShelf is a privacy-oriented writing platform. Unleash the power of your voice. It's free!
Sign up. Join WriterShelf now! Already a member. Login to WriterShelf.
寫程式中、折磨中、享受中 ......
768   0  
·
2018/12/13
·
2 mins read


Sad Danbo / _Hadock_Flickr

我一直很喜歡 JQuery,很簡單又好用,但是啊,就會一直被人家笑,說 JQ 很慢,說厲害的都要用 JavaScript,只有初學的人,才會用 JQ... 我也這麼覺得,所以,我就開始用 JavaScript 了。

結果,我今天花了一整天的時間,就是為了解一個 IE11 JavaScript 的問題,很糟糕的問題,IE11 的用戶,竟然不能存資料了,這簡直就是一個天大的災難,我們只能更用戶說,應該是 IE11 爛,先用 Chrome 或是 FF 吧,我也一直以為是 IE11 爛,它是真的很舊了,但是,也不該當掉啊~

花了一整天,還去 Github 報 bug,結果,才發現,是死在 JavaScript 中的 querySelectorAll 的 forEach,這個問題,只有 IE11 有,詳細的狀況,就像以下這篇,他碰到的情況跟我一樣,我就不再寫一次了,真有興趣的,可以參考:

forEach on querySelectorAll not working in recent Microsoft browsers — I am making a script for choices about a product (colors etc), which works in every browser except for Internet Explorer (11) & Edge. I put the choices of each parameter in a array and apply a Stack Overflow

寫這篇,只是想自省一下,為什麼要讓公司有風險,只為了要讓自己看起來厲害些嗎?

寫 JavaScript 真的有比較高級嗎?沒有,JQuery 會存在這麼久,就是因為他能處理不同瀏覽器間相容的問題,這是一個很大的好處,我學到了教訓,再也不會看不起 JQuery 了! 

附上一篇,有空可以讀讀的「我愛 JQuery 」,很多值得研究的地方。

I Still Love jQuery — And You Should, Too. – Hacker Noon — There’s a big stigma around using jQuery lately . It seems like everyone is insistent on avoiding it in modern JavaScript development… Hacker Noon

 


WriterShelf™ is a unique multiple pen name blogging and forum platform. Protect relationships and your privacy. Take your writing in new directions. ** Join WriterShelf**
WriterShelf™ is an open writing platform. The views, information and opinions in this article are those of the author.


Article info

Categories:
Tags:
Date:
Published: 2018/12/13 - Updated: 2019/08/17
Total: 441 words


Share this article:
About the Author

很久以前就是個「寫程式的」,其實,什麼程式都不熟⋯⋯
就,這會一點點,那會一點點⋯⋯




Join the discussion now!
Don't wait! Sign up to join the discussion.
WriterShelf is a privacy-oriented writing platform. Unleash the power of your voice. It's free!
Sign up. Join WriterShelf now! Already a member. Login to WriterShelf.