-
Notifications
You must be signed in to change notification settings - Fork 57
$.load()
Arthur Guiot edited this page Aug 5, 2017
·
1 revision
This function will basically update a specific element in the DOM from the server.
You can see this function as a smart reload.
Here is how you can use it:
- You can load fragments of the page
- You can update dynamic elements from the servers.
This function will require 3 arguments:
-
el
- This will be the selector (don't use$.s()
method for this.) -
url
- Where to fetch the content -
callback
(optional) - What to do next?
HTML (Client):
<h1>My Goals</h1>
<div class="load"></div>
HTML (Server):
<div class="load">
<p>Understand DisplayJS</p>
<p>Star ⭐️ DisplayJS on GitHub</p>
</div>
JS:
$.load(".load", "projects.php")
- Home
- The Core Languages
- Getting Started: Installation
- The Basics (
$.var()
+$.target()
) - Developing for DisplayJS
-
$.select()
- Text related
- If...else
$.xss()
$.repeat()
$.custom()
$.live()
$.load()
$.on()
$.onEvent()
$.ready()
- Scroll API
$.all()
$.clone()
$.is()
$.valEmpty()
$.remove()
$.show()
&$.hide()
$.ajax()
- Class Related
$.css()
$.getStyle()
- Fade effects
$.extend()
$.dynamic()
$.parent()
- Elements-Nodes
$.component()
$.time_ago()
$.copy()
$.then()
$.sleep()
$.getProp()