I'm currently performing a task which involves getting the information from a file using php and returning it using AJAX. The data is getting sent as I tested this using an alert, however for some reason the line:
param.html(str);
won't change the text in the div...
Here is my function:
function updateChat(param) {
var dataString = 'update=true';
var str = '';
$.ajax({
type: "POST",
url: "inc/chat.php",
data: dataString,
success: function(data) {
str = data;
}
});
param.html(str);
}
Here is how I call my method:
setTimeout(function() {
updateChat('#chatbox');
}, 1000);