2007-11-22, 02:48 AM
Hi,
I wanna use the quickdelete function for my blog system. I created therefore the file comment.js in the folder jscripts:
The template code is this one:
But when I click on the button nothing happens. What is going wrong?
I wanna use the quickdelete function for my blog system. I created therefore the file comment.js in the folder jscripts:
var Comment = {
init: function()
{
},
deleteComment: function(cid)
{
confirmReturn = confirm(quickdelete_confirm);
if(confirmReturn == true) {
form = document.createElement("form");
form.setAttribute("method", "post");
form.setAttribute("action", "editcomment.php?action=deletecomment&delete=yes");
form.setAttribute("style", "display: none;");
var input = document.createElement("input");
input.setAttribute("name", "cid");
input.setAttribute("type", "hidden");
input.setAttribute("value", cid);
form.appendChild(input);
document.getElementsByTagName("body")[0].appendChild(form);
form.submit();
}
},
}
Event.observe(window, 'load', Comment.init);
The template code is this one:
<script type="text/javascript">
document.write('<a href="javascript:Comment.deleteComment({$cid});"><img src="images/bluenight\/postbit_delete.gif" alt="Diesen Kommentar löschen" title="Diesen Kommentar löschen" \/><\/a>');
</script>
But when I click on the button nothing happens. What is going wrong?