Category: jQuery

jQuery / .ajax() / Synchronous Requests and an Asynchronous Alternative
Understand how async:false changes execution order and responsiveness. A complete local server example compares synchronous calls with ordered asynchronous requests, failure, timeout and cancellation.

jQuery / Method / .load() - Load HTML into an Element
Fetch full HTML or a selected fragment with .load(). Two complete files and a local server demonstrate asynchronous completion, 404 handling, script differences and delegated events.

jQuery / Method / .scrollTop() - Read or Set Vertical Scroll Position
Read and set page or container scrolling with .scrollTop(). A complete example explains limits, bottom detection, first-element getters, setters for all matches and resetting both positions.

jQuery / Method / .toggle() - Show or Hide Elements
Compare immediate inversion, Boolean state setting and timed .toggle() animations. A complete two-panel example covers callbacks, repeated clicks, preserved inputs and resetting during an effect.

jQuery / Method / .slice() - Select an Index Range
Learn inclusive start, exclusive end and negative indices in .slice(). A complete list example covers filter order, empty ranges, dynamic items and calculating page subsets.

jQuery / Method / .resize() - Handle Window Size Changes
Handle window size changes with .on("resize", …). A complete example covers initial rendering, debounce, removing and restarting listeners, and synthetic notifications that do not resize the window.

jQuery / Method / .replaceWith() - Replace Entire Elements
Replace whole elements with .replaceWith() and handle its return value correctly. Complete examples cover new references, transferring edited values, event behavior and moving existing nodes.

jQuery / Method / .prop() - Read and Set DOM Properties
Use .prop() for current checked and disabled states. Runnable examples explain HTML attributes versus DOM properties, object and callback setters, change events and form reset behavior.

jQuery / Method / .parent() - Select Immediate Parent Elements
Use .parent() to select immediate parents and filter them by a selector. A complete nested-card example explains shared-parent deduplication, .parents() versus .closest(), and results after changing the structure.

jQuery / Method / .offset() - Read or Set Document Coordinates
Distinguish document coordinates from viewport and parent-relative positions with .offset(). A complete example covers scrolling, moving, margins and borders, hidden elements and fractional coordinates.