Skip to content

Commit

Permalink
Sync: 2024-01-25 20:24:25
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelAllen committed Jan 26, 2024
1 parent 3369a9a commit 314ed0b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Rock/z_Other/run-javascript-on-page-load.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ tags:
- language/js
- type/utility
date created: 2020-12-01 22:37:24
date modified: 2022-01-01 18:16:37
date modified: 2024-01-25 20:03:36
---

# Run Javascript on Page Load

There are 2 options here. Which one to use depends on what you are trying to do. I tent to use option 1 as a default, and only switch to option 2 if I need to have my code run on every postback (ex: modifying a control on the page that changes on postback)

If you need to interact with an Obsidian control, neither of these options will work. You will have to use a mutation observer instead.

## Option 1 - jQuery

This will execute once the page has finished loading. It _will not_ run on postbacks.
Expand Down

0 comments on commit 314ed0b

Please sign in to comment.