I have this code:
var callbackAfterLoad = function(data, ecBlock) {
ecBlock.html(data);
ecBlock.slideDown();
}
function bindevents(userInput, ecBlock, callbackAfterLoad) {
userInput.keyup(function () {
delay(function () {
$.post("/preview", {content:userInput.val()}, callbackAfterLoad(data, ecBlock));
}, 500);
});
}
And this error:
Uncaught ReferenceError: data is not defined
But when I check out jQuery examples
$.post("test.php", function(data) {
alert("Data Loaded: " + data);
});
Why do I got this error ? Why do jQuery example is working and not mine ? (we cannot add parameters ?). Is the default $.post callback defined and his signature cannot be overriden ?