Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#8799 closed bug (invalid)

document loading events ready through error!

Reported by: awakeel Owned by:
Priority: undecided Milestone: 1.next
Component: unfiled Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:


document loading events ready






$.ready( alert('test');)

Through error, when i remove semi colon then its work fine. is it bug or user mistake. correct me if i am wrong?

Change History (4)

comment:1 Changed 12 years ago by ajpiano

Resolution: invalid
Status: newclosed

This is a user mistake. You have to pass a function reference to $(document).ready(), you are *executing* a window alert and passing its return value (nothing) to document ready as a handler. The correct syntax would be

$(function() {

comment:2 Changed 12 years ago by awakeel

All three of the following syntaxes are equivalent:

$().ready(handler) (this is not recommended)

The three format is supported so i am using the last one. did you checked that.

Last edited 12 years ago by awakeel (previous) (diff)

comment:3 Changed 12 years ago by ajpiano

A function reference is not the same as executing a function. http://fixingthesejquery.com/#slide32

comment:4 Changed 12 years ago by awakeel


Note: See TracTickets for help on using tickets.