Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#9763 closed bug (worksforme)

getJSON() doesn't execute callback function when formatted certain ways

Reported by: [email protected] Owned by:
Priority: low Milestone: 1.next
Component: ajax Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:


This doesn't work:

$.getJSON("ForgotYourPassword.php", function() {

console.log("Won't be outputted");


but this does:

$.getJSON("ForgotYourPassword.php", login_forgotYourPassword2());

login_forgotYourPassword2=function() {

console.log("Will be outputted");


Change History (4)

comment:1 Changed 12 years ago by anonymous


JSON was improperly formatted.

comment:2 Changed 12 years ago by addyosmani

Component: unfiledajax
Priority: undecidedlow
Resolution: worksforme
Status: newclosed

As confirmed by the original ticket submitter, this issue has now been resolved. Marking as worksforme/user error.

comment:3 Changed 12 years ago by Rick Waldron

For good measure, the only reason your second example "worked" was because the function expression was being invoked with ()

comment:4 Changed 12 years ago by anonymous

Thank you! Apologies about the false alarm.

Note: See TracTickets for help on using tickets.