Posts Tagged ‘javascript’

HTML: How to include JavaScript or jQuery in 1 Line

How to include JavaScript in HTML in 1 Line:

<script src = "app.js"> </script>

How to include jQuery in HTML in 1 Line:

<script src = "jquery.min.js"></script>

Ready, set, go! Waiting on Page Loads in JavaScript

Another JavaScript basic — use $(document).ready() to wait for an HTML document to load completely before running whatever function you put in ready()

Quick Tip: Use toggle() and show() in JavaScript Menus

Continuing the series of posts on basic JavaScript:

toggle() alternates something between showing itself and hiding, usually based on a .click() function

show(), on the other hand, conditionally show an element, but don’t let it disappear like toggle() does

Both are widely useful, with menus being a common use case.

Quick Tip: Run JavaScript Code Block if an Element has been Clicked (in 1 Line)

.click(function(){CODE TO RUN GOES HERE})

Stackoverflow Solutions

Just started! Have not answered any questions.