Side navigation
#9763 closed bug (worksforme)
Opened July 07, 2011 01:01AM UTC
Closed July 07, 2011 06:34AM UTC
Last modified March 14, 2012 04:36AM UTC
getJSON() doesn't execute callback function when formatted certain ways
Reported by: | jeffzimmerlin@gmail.com | 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");
}
Attachments (0)
Change History (4)
Changed July 07, 2011 01:11AM UTC by comment:1
Changed July 07, 2011 06:34AM UTC by comment:2
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.
Changed July 07, 2011 01:41PM UTC by comment:3
For good measure, the only reason your second example "worked" was because the function expression was being invoked with ()
Changed July 07, 2011 02:35PM UTC by comment:4
Thank you! Apologies about the false alarm.
Resolved.
JSON was improperly formatted.