Page 1 of 1

callback function > return string

Posted: Sat Jul 13, 2013 10:13 am
by pedroz
I would like to get the word 'test' from the callback function psCallback below.

alert(opt); is now displaying the word 'test'

What am I doing wrong?

Code: Select all

function psCallback() {
	var content = 'test';
	
	return content;
}
	
	
jQuery(document).ready(function () {
	
	var opt = {callback: psCallback};
		
	alert(opt);	
		
	return false;

});

Re: callback function > return string

Posted: Sat Jul 13, 2013 7:19 pm
by requinix

Code: Select all

alert(opt.callback());