I’m using jQuery to do an AJAX POST request. Here’s the code
jQuery(document).ready(function() {
jQuery('#tweets').load('/index.php?app=ccs&module=pages§ion=pages&id=6');
var refreshId = setInterval(function() {
jQuery('#tweets').load('/index.php?app=ccs&module=pages§ion=pages&id=6');
}, 30000);
});
jQuery(function() {
jQuery(".button").click(function() {
var dataString = 'tweet='+ tweet;
//alert (dataString);return false;
$.ajax({
type: "POST",
url: "/index.php?app=ccs&module=pages§ion=pages&id=7",
data: dataString,
success: function() {
$('#postsuccess').html("<b>Post Successful</b>");
}); // this is where the parse error is
}
});
return false;
});
});
Any ideas?
That’s why formatting code is important
and try to combine it all, like:
if you are not using any other javascript framework, you can replace all
jQuerywords for the$sign, like:and your
$.ajaxmethod should be