Why jQuery is better than regular Javascript

  • 1
  • Praise
  • Updated 6 years ago
This post is to you people who are a little experienced in Javascript.

jQuery makes writing code 10x easier.

For example to hide something in jQuery you would do:


$('#element').hide();


In regular Javascript it would be:


var hide = "none";//this var isnt needed
document.getElementById("element").style.display = hide;


I posted this because I see the yola sites have a little javascript on the bottom which is still regular Javascript. I won't post it because that would allow more experienced users to hide the credits. Just wanted to point out how much faster jQuery is. I recommend using jQuery for any future projects yola. It will make everything go faster.

This might be one of my last post on this forum. Because I will now be moving from yola and will be building my own ".php" websites. By hand so I hope everyone enjoyed me giving away codes. I will post on here again for the last code request post plus I will be introducing my website.

Thanks so much yola.
You got my web design career started :)
Photo of Shawn Holman

Shawn Holman

  • 486 Posts
  • 26 Reply Likes
  • thankful

Posted 6 years ago

  • 1
Photo of Laura Thomas

Laura Thomas, Social Media Coordinator

  • 4536 Posts
  • 211 Reply Likes
We are glad we could help you to get started with sitebuilding Shawn. We wish you all the best. Good luck in your future endeavors.
Photo of nerd313337

nerd313337

  • 1 Post
  • 0 Reply Likes
Have you ever ACTUALLY looked at the performance difference.
http://jsperf.com/vanilla-js-v-jquery...
Photo of Shawn Holman

Shawn Holman

  • 486 Posts
  • 26 Reply Likes
I wasn't saying that it works faster. I meant that coding with it is faster and it's smarter to do so. Coding with any library would be the smart way to go. If you are an ACTUAL professional at JavaScript than you are not gonna wanna write out a thousand line script with Traditional JavaScript, or "Vanilla JS". You can have fun with your Vanilla JS, but I write lots of JavaScript and I would not like to spend 10 minutes on making one function that involves a whole bunch of complex features when with a library such as jQuery I can use 1 or 2 lines.

There are times when jQuery should be admitted and that is mainly when using any kind of loop (for, for..in, for..of, while, do..while). But other than that, it really isn't that big of a deal unless performance is THAT crucial to you.

Good Day.
Photo of Shawn Holman

Shawn Holman

  • 486 Posts
  • 26 Reply Likes
And it's funny that you are calling my code the "Vanilla JS Retarded Suggestion" when each time I tried it, it was faster than the regular Vanilla JS one. Like, really.
Photo of Laura Thomas

Laura Thomas, Social Media Coordinator

  • 4536 Posts
  • 211 Reply Likes
nerd313337,

You are entitled to your opinion and we welcome you to share it here, but we do request you do so in a polite and respectful manner. Some phrasing in the link you posted above is not inline with keeping a free and open dialog. Please be aware of this in future communications.