hub.eb?material_id=304&track_id=309

jQuery Ready Events


The jQuery ready event will be triggered in two instances:-

  • Once the page has loaded for the first time.
  • Any time the AJAX mechanism refreshes the page.

This can be useful for client-side tasks such as drawing a graph when the page loads and redrawing it when the data in the page changes.

You can create ready Event Handlers on any control and all these Handlers run when the jQuery event occurs irrespective of where the Control is on the page or whether it is showing.

Steps


1

Create a Form and add a Button Control with the text: Refresh.

2

Open the HTML Element Properties of the Button Control and assign it the id: testReadyEvent.

Create a jQuery ready Event Handler with the following code:

alert("Ready event fired!");

 

3

Run the Form.

You should see an alert pop up when the page loads and each time you click the button.

Current Module

Part of tracks

Related