Note that there are some explanatory texts on larger screens.

plurals
  1. POAjax success callback for 'delete' not triggering in Firefox
    primarykey
    data
    text
    <p>I have got a test page to use Ajax to make a http 'delete' request to a server. The following JS code works as intended in IE7, but it does not work in Firefox (unless I make the ajax call asynchronous).</p> <p>In Firefox, unless async is false, the error callback gets triggered with status of 0. </p> <ol> <li>Can anyone assist in explaining why this is apparently working in Firefox if the call is synchronous?</li> <li>In the context of this page, a synchronous call is not a bad thing, however I have read that this should be avoided as this would effectively freeze the browser window until the response had returned. Is there an alternative solution anyone can suggest?</li> </ol> <p>The relevant code is below:-</p> <pre><code>&lt;script src="${url.context}/scripts/jquery-1.3.2.min.js"&gt;&lt;/script&gt; &lt;SCRIPT LANGUAGE="JavaScript"&gt; jQuery.noConflict(); function deleteImage(nodeParam) { alert('hello'); var options = { type: 'DELETE', async: false, url: '${url.context}/service/api/asset/delete?alf_ticket=${session.ticket}'+'&amp;format=text'+'&amp;'+nodeParam, dataType: 'json', success: function(data, textStatus) { jQuery('#result-div').html(''); if (data['ok'] == true) { //jQuery('#result-div').html('Delete successful using parameter - ' + nodeParam); alert("Delete successful" ); } else { alert( "Response 'ok' set to 'false' on success callback!" ); jQuery('#result-div').html('Delete failed!'); } }, error: function (request, textStatus, errorThrown) { //jQuery('#result-div').html('Delete failed!'); alert("Delete Failed"); alert(request.status); //alert("Error callback triggered, request failed with status: " + request.status + ' ' + request.responseText); } }; jQuery.ajax(options); } // End --&gt; &lt;/script&gt; </code></pre> <p>Thanks J</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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