Note that there are some explanatory texts on larger screens.

plurals
  1. POproblem ajax load with autocomplete.?
    primarykey
    data
    text
    <p>i created a jquery autocomplete it work true, but loading <code>LOADING...</code> it after removed value by <code>Backspace</code> don't work true. it not hide and Still is show.<p> how can after removed value by <code>Backspace</code>, hide <code>LOADING...</code> ?<p> <strong>EXAMPLE:</strong> <a href="http://www.binboy.gigfa.com/admin/tour_foreign/insert_foreign" rel="nofollow">Please click on link and see problem</a> <p> my full code:</p> <pre><code>$(document).ready(function () { /// LOADING... /////////////////////////////////////////////////////////////////////////////////////// $('#loadingDiv') .hide() // hide it initially .ajaxStart(function() { $(this).show(); }) .ajaxStop(function() { $(this).hide(); }); /// autocomplete ///////////////////////////////////////////////////////////////////////////////////////// $('.auto_complete').keyup(function () { var specific = '.' + $(this).closest('div.auto_box').find('b').attr('class'); var cl_list = '.' + $(this).closest('div.auto_box').find('ul').attr('class'); var id = '#' + this.id; var url = $(id).attr('class'); var dataObj = $(this).closest('form').serialize(); $.ajax({ type: "POST", dataType: 'json', url: url, data: dataObj, cache: false, success: function (data) { //alert(url) var cl_list = '.' + $('.auto_box '+ specific +' ul').attr('class'); var id_name = $(cl_list).attr('id'); $(cl_list).show().html(''); if (data == 0) { $(cl_list).show().html('&lt;p&gt;&lt;b&gt;There is no&lt;/b&gt;&lt;/p&gt;'); } else { $.each(data, function (a, b) { //alert(b.name) $('&lt;p id="' + b.name + '"&gt;' + b.name + '&lt;/p&gt;').appendTo(cl_list); }); $(cl_list + ' p').click(function (e) { e.preventDefault(); var ac = $(this).attr('id'); $('&lt;b&gt;' + ac + '، &lt;input type="text" name="'+id_name+'[]" value="' + ac + '" style="border: none; display: none;" /&gt;&lt;/b&gt;').appendTo($('.auto_box ' + specific + ' span')); $(this).remove(); return false; }); $('.auto_box span b').live('click', function (e) { e.preventDefault(); $(this).remove(); return false; }); } if ($(specific + ' input').val() == '') { $(cl_list + " p").hide().remove(); $(cl_list).css('display','none'); $(".list_name").show().html(''); }; $('body').click(function () { $(cl_list + " p").hide().remove(); $('.auto_complete').val(''); $(cl_list).show().html(''); $(cl_list).css('display','none') }); }, "error": function (x, y, z) { // callback to run if an error occurs alert("An error has occured:\n" + x + "\n" + y + "\n" + z); } }); }); }); </code></pre>
    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