Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery .load firing twice, but being called once
    text
    copied!<p>I have a problem here, my jquery .load function seems to be running twice even though Im only calling it once. Here is my code:</p> <pre><code>function updateRowItem(idIn){ if (ready) { id = idIn $("#controlPanelResult").css("background-color", ""); var query = {}; var tid = id.replace("@", "\\@"); tid = tid.replace(".", "\\."); var value = $('#'+tid).text(); //var value = decodeURI(document.getElementById(id).innerHTML); //if (value == "&lt;br&gt;"){ // value = "NULL" //} //value = value.replace("&amp;nbsp;"," ") //value = value.replace("&amp;amp;","&amp;") var split = id.split('@'); var temp = split[0]; var uuid = split[1]; var temp2 = temp.split('.'); var tableName = temp2[0]; var item = temp2[1]; query['table_name'] = tableName; query['uuid'] = uuid; query[item] = value; var tid = id.replace("@", "\\@"); tid = tid.replace(".", "\\."); $.ajax({ async: false, type: "POST", //url: '/admin/updateRow?table_name=' + tableName + "&amp;uuid=" + uuid +"&amp;" + item + "=" + value, url: '/admin/updateRow', data: query, success: function(data) { if (data == "1"){ alert ("Hellooo!")//This alert only and always pops up once $('#'+tid).empty().load(showRowsUrl + " #" + tid,function (status) { alert (status) // This alert pops up first once, then twice, then four times, then eight etc.... $("#"+tid).animate({backgroundColor: '#70DB70'}, 'slow'); $('#controlPanelResult').html("Updated: " + id); $("#controlPanelResult").animate({ backgroundColor: '#70DB70'}, 'slow'); $("#"+tid).animate({backgroundColor: 'white'}, 'slow'); }); } else { $('#mainRows').load(showRowsUrl, function() { $("#"+tid).animate({backgroundColor: 'red'}, 'fast'); $('#controlPanelResult').html(data); $("#controlPanelResult").animate({backgroundColor: 'red'}, 'fast'); }); } } }); } } </code></pre> <p>This causes my divs contents to be constantly repeated, I would appreciate any help in figuring this out</p>
 

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