Hey all,
Perplexing issue, this one, and quite complex.
Basically I have a page, blogs.php, which makes an ajax call to another page, blog_data.php and outputs a bunch of blog entries to a page.
On each blog entry, it outputs a button similar to the following:
Code:
<input type='button' onclick='deletePost(blogid)'>
Where blogid is the ID number in the database.
In the head of blogs.php, I have embedded the following javascript (this is in a separate .js file to the ajax calls to generate the blog):
Code:
$(document).ready(function() {
function deletePost(post) {
var deleteyes = confirm("Are you sure?");
if(deleteyes) {
loading_show();
$.ajax
({
type: "POST",
url: "content/userpage/blog_delete.php",
data: "post="+post,
success: "loadData(1);",
});
}
else {
}
}
});
For some reason, when I click my delete button, it does nothing, and firebug is reporting that deletePost is not defined.
Can anyone help?