• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

TeraTech

The ColdFusion Experts: Develop | Secure | Optimize

  • Services
    • Consulting
    • Crash
    • Development
    • Maintenance
    • Modernization
    • Security
  • About Us
  • Testimonials
  • Free Assessment
  • Get in touch!

  • Services
    • Consulting
    • Crash
    • Development
    • Maintenance
    • Modernization
    • Security
  • About Us
  • Testimonials
  • Free Assessment
  • Get in touch!

18 Amazing JQuery tips & Tricks (Supercharge Web 2.0 apps)

February 28, 2023 By Michaela Light Leave a Comment

Here are 18 amazing JQuery tips that Jo Ann shared after CFUnited this year. Enjoy!

PS What are your JQuery tips and tricks?

  1. Syntax:  The dollar sign ($) is an alias for the jQuery object.
  2. Best documentation (online reference) is:   http://docs.jquery.com/   [www.visualjquery.com, which I have used, is only up to version 1.2.6 (and the current release is 1.3.2)]
  3. OK to call the $(document).ready() function as many times as you want on the same page.  They will execute in turn; they don't overwrite each other.  This is in direct contrast to the more traditional body onload attribute, where it is NOT OK to use more that one definition. If you add 2 definitions for body onload, the 2nd overwrites the first, and the first is never executed.
  4. In JavaScript, the Function IS a datatype.  This is very important in jQuery, because many jQuery methods take functions as parameters.
  5. Named functions:  doSomething(param1, param2) { [some action statements in here]; }  If I set myVar1 = doSomething(“foo”,”bar”); then myVar1 contains the RESULT of doing something with “foo” and “bar”.  But if I set myVar2 = doSomething;     (i.e., without the parens) now myVar2 IS the same function as doSomething.  Now myVar2(“foo”,”bar”); will return the same thing as doSomething(“foo”,”bar”);  This concept can be useful if you need to pass functions to a method that takes one or more Functions as arguments.
  6. An Anonymous Function in JavaScript is a Function declaration without a name.  For example, $(document).ready() takes as an argument a Function that receives the ready event as an argument.  Typically instead of declaring a named function and putting the name inside the ready() parens, you put ready(function(event){ [what to do goes in here]; })
  7. Can use jQuery to intercept a button click or other event, do some validation or manipulation with information on the page, and submit a hidden form instead of ever giving the user direct access to the form inputs.  Also for CFFORM augmentation – for example to grab the error messages and log them, to do some analysis before submission, to visually magnify the field with incorrect input so the user can see it better to verify.
  8. Can overload existing JavaScript functions.  For example, overloading alert() could make the standard CF-generated validation messages display in a nicer alternative appearance and style.
  9. Syntax: .attr(‘[attribute_name]') is a getter, and .attr(‘[attribute_name],'[value]”) is a setter.
  10. Syntax: the filter  :eq(3)  gets the 3rd element of a set, while  :nth(3)  gets EVERY 3rd (i.e., 3, 6, 9, 12 …)
  11. A filter such as  :last  is applied to the selected / returned SET of elements – so ‘li:last'  gets the last <li> element on the page, NOT the last item in EACH list on the page.
  12. Syntax: A space in a selector (example ‘#list2 li:last') means get all of the 2nd selector that are descendants of the element(s) returned by the first selector (as opposed to separating with > which signifies “direct children” instead).
  13. Utilities are jQuery methods without selectors [examples:     $.each()   or   $.support()   ]
  14. How people create compressed and obfuscated JaveScript files: jsmin utility to strip out extraneous white space, yuicompressor to obfuscate by replacing variable names with something less easy to understand.  (However, JS is always still out in the world for everyone to see!)
  15. jQuery UI is the only jQuery plugin created by jQuery itself.  Use Theme Roller: http://jqueryui.com/themeroller/  to create custom UI themes (try out and style the various UI elements).
  16. http://layout.jquery-dev.net  – look at Layout Inside Dialog
  17. Syntax tip: parseInt('30px') takes the 30 out of '30px'
  18. Can use jQuery along with CF-generated JavaScript validation, for instance to enable/disable/re-enable CF validation in response to a browser-side event of some kind.
  • Facebook
  • Twitter
  • LinkedIn

Related Posts

  • 095 ColdFusion CommandBox vs Node.js, with Nolan Erck
  • CF Camp 2018: Madness in Munich Part Five- AngularJS + ColdFusion

Filed Under: JavaScript

← Previous Post New Adobe ColdFusion Builder (VS Code extension) beta release
Next Post → 118 Into The Box ColdFusion Conference 2022 (new details revealed) with Gavin Pickin – Transcript

Primary Sidebar

Popular podcast episodes

  • Revealing ColdFusion 2021 – Rakshith Naresh
  • CF and Angular – Nolan Erck
  • Migrating legacy CFML – Nolan Erck
  • Adobe API manager – Brian Sappey
  • Improve your CFML code – Kai Koenig

CF Alive Best Practices Checklist

Modern ColdFusion development best practices that reduce stress, inefficiency, project lifecycle costs while simultaneously increasing project velocity and innovation.

Get your checklist

Top articles

  • CF Hosting (independent guide)
  • What is Adobe ColdFusion
  • Is Lucee CFML now better than ACF?
  • Is CF dead?
  • Learn CF (comprehensive list of resources)

Recent Posts

  • 141 Into The Box 2025 ColdFusion conference (all the details) with Daniel Garcia – Transcript
  • 141 Into The Box 2025 ColdFusion conference (all the details) with Daniel Garcia
  • 107 ColdFusion 2021 Revealing Details on How it was Created with Rakshith Naresh
  • The Legacy Continues: ColdFusion Summit East Conference Edition
  • 140 BoxLang modern JVM language that runs CFML code (new CFML engine and much more) with Luis Majano and Brad Wood – Transcript

Categories

  • Adobe ColdFusion 11 and older
  • Adobe ColdFusion 2018
  • Adobe ColdFusion 2020 Beta
  • Adobe ColdFusion 2021
  • Adobe ColdFusion 2023
  • Adobe ColdFusion 2024
  • Adobe ColdFusion 2025
  • Adobe ColdFusion Developer week
  • Adobe ColdFusion Project Stratus
  • Adobe ColdFusion Summit
  • AWS
  • BoxLang
  • CF Alive
  • CF Alive Podcast
  • CF Camp
  • CF Tags
  • CF Vs. Other Languages
  • CFEclipse
  • CFML
  • CFML Open- Source
  • CFUnited
  • ColdBox
  • ColdFusion and other news
  • ColdFusion Community
  • ColdFusion Conference
  • ColdFusion Consulting
  • ColdFusion Developer
  • ColdFusion Development
  • ColdFusion Hosting
  • ColdFusion Maintenance
  • ColdFusion Performance Tuning
  • ColdFusion Projects
  • ColdFusion Roadmap
  • ColdFusion Security
  • ColdFusion Training
  • ColdFusion's AI
  • CommandBox
  • Docker
  • Fixinator
  • Frameworks
  • Fusebox
  • FusionReactor
  • IntoTheBox Conference
  • Java
  • JavaScript
  • JVM
  • Learn CFML
  • Learn ColdFusion
  • Legacy Code
  • Load Testing
  • Lucee
  • Mindmapping
  • MockBox
  • Modernize ColdFusion
  • Ortus Developer Week
  • Ortus Roadshow
  • Server Crash
  • Server Software
  • Server Tuning
  • SQL
  • Survey
  • Survey results
  • TestBox
  • Transcript
  • Webinar
  • Women in Tech

TeraTech

  • About Us
  • Contact

Services

  • Free assessment
  • Consulting
  • Crash
  • Development
  • Maintenance
  • Modernization
  • Security
  • Case Studies

Resources

  • CF Alive Book
  • CF Alive Podcast
    • Podcast Guest Schedule
  • TeraTech Blog
  • CF Alive resources
  • CF e-course
  • CF best practice checklist

Community

  • CF Alive
  • CF Inner Circle
  • CF Facebook Group

TeraTech Inc
451 Hungerford Drive Suite 119
Rockville, MD 20850

Tel : +1 (301) 424 3903
Fax: +1 (301) 762 8185

Follow us on Facebook Follow us on LinkedIn Follow us on Twitter Follow us on Pinterest Follow us on YouTube



Copyright © 1998–2025 TeraTech Inc. All rights Reserved. Privacy Policy.