Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Nischo, I cannot replicate the blocking when inserting your <code>AJAX</code> code into the <code>change</code> function. If you are looking to block the <code>AJAX</code> if executing when the <code>click</code> is fired on the submit look here.</p> <p><a href="https://stackoverflow.com/questions/1921855/jquery-how-can-i-temporarily-disable-the-onclick-event-listener-after-the-even">jQuery - How can I temporarily disable the onclick event listener after the event has been fired?</a></p> <p>Best of luck.</p> <hr> <p>After your explanation I do see what you are referring to, since the <code>change</code> event requires lost focus to fire your <code>click</code> function is overridden as a result of the blocking caused by the lost focus being your click.</p> <p>You could use the <code>timeOut</code> as you stated or you could refactor to a <code>keydown</code> method on your <code>text</code> input. See below:</p> <pre><code>$(document).ready(function () { $("input[type=submit]").click(function () { $("#text").text('clicked'); }); $("input[type=text]").keydown(function () { alert('changed'); $("#text").text('changed'); }); }); </code></pre> <p><strong>Fiddle:</strong> <a href="http://jsfiddle.net/9WXBe/2/" rel="nofollow noreferrer">http://jsfiddle.net/9WXBe/2/</a></p> <hr> <p>Nischo,</p> <p>After taking your code and placing it in jsFiddle I do not see any problems with the change event being fired. Even with an <code>alert</code> in the code.</p> <p><code>$("input[type=text]").change()</code> will not fire until the textbox loses focus, other elements such as <code>select</code>, <code>radio</code> will perform this action immediately after a selection or change is made.</p> <p>Here is the fiddle: <a href="http://jsfiddle.net/w9Thc/1/" rel="nofollow noreferrer">http://jsfiddle.net/w9Thc/1/</a></p>
    singulars
    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.
    1. VO
      singulars
      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