javascript - Uncaught TypeError undefined is not a function when called outside of jQuery -


i'm trying figure out why when call setupcontrolbox within $.getjson call works (in if condition) if call else condition throws undefined error (i set opts.load_url false). call have encapsulated in $.somefunction()?

// load existing form data  if (opts.load_url) {     $.getjson(opts.load_url, function(json) {         form_db_id = json.form_id;         fromjson(json.form_structure);         opts.loaded(json);         var controlbox = setupcontrolbox(opts.control_box_target);     }); } else {     var controlbox = setupcontrolbox(opts.control_box_target);       } 


Comments

Popular posts from this blog

C# random value from dictionary and tuple -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -