Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
User is typing
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="NSA" data-source="post: 200409" data-attributes="member: 10034"><p>Managed to get this 'somewhat' working by using this:</p><p> </p><p>[HTML]var typingTimer;</p><p>var Interval = 5000;</p><p> </p><p> </p><p>$('#chatlol').keyup(function(){</p><p> typingTimer = setTimeout(finTyping, Interval);</p><p>});</p><p> </p><p> </p><p>$('#chatlol').keydown(function(){</p><p> clearTimeout(typingTimer);</p><p>});</p><p> </p><p> </p><p>function finTyping () {</p><p> alert("Finished");</p><p>}[/HTML]</p><p> </p><p>The only problem is, when the user finishes typing, the alert pops up three times, which means the ajax request would be sent three times. If MySQL tried removing something that didn't exist, pretty sure an error would be displayed. </p><p>Can you see why it's throwing it three times?</p></blockquote><p></p>
[QUOTE="NSA, post: 200409, member: 10034"] Managed to get this 'somewhat' working by using this: [HTML]var typingTimer; var Interval = 5000; $('#chatlol').keyup(function(){ typingTimer = setTimeout(finTyping, Interval); }); $('#chatlol').keydown(function(){ clearTimeout(typingTimer); }); function finTyping () { alert("Finished"); }[/HTML] The only problem is, when the user finishes typing, the alert pops up three times, which means the ajax request would be sent three times. If MySQL tried removing something that didn't exist, pretty sure an error would be displayed. Can you see why it's throwing it three times? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
User is typing
Top