window.addEvent('domready', function(){ /* AJAX-SHIT!!!1!1elf This calls the ajax-comments.php instead of the * wp-comments-post.php if js is enabled, and posts comments by xhr. * ==================================================================== */ if ($('commentform')) { /* We have a commentform on the page and javascript is working - * let's change the action path to the ajax-comments.php-script */ url = 'https://inzec.ch/wp-content/themes/grava/script/ajax-comments.php' $('commentform').setProperty('action', url); $('commentform').addEvent('submit', function(e) { // Prevent the submit event new Event(e).stop(); this.send({ onFailure: function() { if (!$('commenterror')) { var error = new Element('li', { 'id': 'commenterror' }); error.setHTML('Dein Kommentar konnte leider nicht eingetragen werden, da ein Serverfehler vorzuliegen scheint.'); error.injectBefore($('lastcommentsformli')); } else { $('commenterror').setHTML('Dein Kommentar konnte leider nicht eingetragen werden, da ein Serverfehler vorzuliegen scheint.'); } }, onSuccess: function() { // added a new comment sucessfully? if (this.response.text.contains('