Comment on Israeli Mossad launches cyber challengeComments−hashberry7yThis site loads the jQuery library in order to...1. Access $("#text1")[0].innerHTML2. $( document ).ready() { typeWriter (); }facepalm−whoisjuan7yIt's done like that because the typeWriter effect is actually rendering line break elements (<br>) as it shows up.−hashberry7ywoosh, loading jQuery to access an element is not needed. document.getElementById would suffice.−whoisjuan7yjQuery is still a valid way to manipulate the DOM. There’s nothing wrong with doing that, especially if you already need to load jQuery for something else. I don’t think this is what the comment was referring to.−hashberry7yThere's no reason to load a 30KB JavaScript library for such a simple webpage. See http://youmightnotneedjquery.com/
Comments
This site loads the jQuery library in order to...
1. Access $("#text1")[0].innerHTML
2. $( document ).ready() { typeWriter (); }
facepalm
It's done like that because the typeWriter effect is actually rendering line break elements (<br>) as it shows up.
woosh, loading jQuery to access an element is not needed. document.getElementById would suffice.
jQuery is still a valid way to manipulate the DOM. There’s nothing wrong with doing that, especially if you already need to load jQuery for something else. I don’t think this is what the comment was referring to.
There's no reason to load a 30KB JavaScript library for such a simple webpage. See http://youmightnotneedjquery.com/