Note that there are some explanatory texts on larger screens.

plurals
  1. PO$$('a.deleteButton').invoke('observe', 'click', function(e) not working in Internet Explorer
    primarykey
    data
    text
    <p>My Code actually works quite good in chrome, but testing it in IE fails :/ e.element().hide() and e.element().insert() is not working. The Ajax.Request() is working fine in both browsers. Any idea how to fix?</p> <pre><code>$$('a.deleteButton').invoke('observe', 'click', function(e) { var commentID = parseInt(this.readAttribute('data-commentid')); e.stop(); new Ajax.Request('index.php?action=CNewsComment', { method: 'POST', parameters: {entryID: commentID, cNewsAction: 'delete'}, onSuccess: function(transport){ new Effect.toggle('commentID' + commentID, 'Appear', {duration:0.5}); var count = parseInt($('commentsCount').innerHTML.stripTags()); $('commentsCount').innerHTML = count-1; }, onLoading: function(transport){ e.element().hide(); //not working in IE but in Chrome if ($('deleteLoading' + commentID)) { $('deleteLoading' + commentID).show(); } else { e.element().up().insert ({ 'before' : '&lt;img id="deleteLoading' + commentID + '" src="' + RELATIVE_WCF_DIR + 'images/cNewsSpinnerS.gif" alt="" /&gt;' }); } }, onFailure: function(transport){ e.element().show(); $('deleteLoading' + commentID).hide(); alert("An error occurred: " + transport.status + ' - ' + transport.statusText); } }); }); </code></pre> <p><strong>UPDATE: If I put the code which is not working in IE outside the AJAx-Request, it is working:</strong></p> <pre><code>$$('a.deleteButton').invoke('observe', 'click', function(event) { event.stop(); // IE PART START event.element().hide(); if ($('deleteLoading' + commentID)) { $('deleteLoading' + commentID).show(); } else { event.element().up().insert ({ 'before' : '&lt;img id="deleteLoading' + commentID + '" src="' + RELATIVE_WCF_DIR + 'images/cNewsSpinnerS.gif" alt="" /&gt;' }); } // IE PART END new Ajax.Request('index.php?action=CNewsComment', { method: 'POST', parameters: {entryID: commentID, cNewsAction: 'delete'}, onLoading: function(transport){ } </code></pre> <p>But inside the onLoading-function it isnt, why?!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload