jQuery jquery-snippets

Published on October 7th, 2013 | by Mark Ammay

2

jQuery Snippets

I mainly added these jquery snippets for myself, so I could refer to them when needed (instead of having to google it again).

You may already know these by heart, but if not here’s a good page to bookmark.


:contains

– Good to use if you need to find a specific div that contains a string.

.parent

– If you need to reach a parent of a div, or a parent parent.

If does not have class

– Simple way to find a div that does not contain something

 

Different click events

– Various click event styles depending on what you need. “Live” should not be used anymore.

 Check / Uncheck Input Boxes

– Easily check and uncheck input boxes.

 Ajax Calls

– Simple Ajax calls to get / post json or other data.

Example JSON, for loops, .each, for key in obj

Here’s a few JSON Examples and how to parse them with jQuery.

Show Exit Message with default and custom popup

 


Tags: , , , , , , , ,


About the Author

Hey it's Mark Ammay. I'm a Web Developer with over 5 years of professional experience in the industry. I help individuals start their own website from scratch, as well as through WordPress. I'm also an Online Entrepreneur who blogs at www.MarkAmmay.com



1 comments
Back to Top ↑