#9763 closed bug (worksforme)
getJSON() doesn't execute callback function when formatted certain ways
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | ajax | Version: | 1.6.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
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
comment:2 Changed 12 years ago by
Component: | unfiled → ajax |
---|---|
Priority: | undecided → low |
Resolution: | → worksforme |
Status: | new → closed |
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
For good measure, the only reason your second example "worked" was because the function expression was being invoked with ()
Note: See
TracTickets for help on using
tickets.
Resolved.
JSON was improperly formatted.