Solved

clear div 5 seconds after ajax returns value

Posted on 2010-08-26
4
360 Views
Last Modified: 2013-12-13
I am trying to figure out how I can make a div clear all of its information about 5 seconds after it appears..I am running an ajax script and I just want the information it returns to appear for a few seconds then dissapear.
0
Comment
Question by:brad0525
  • 2
4 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 33535961
in your callback function (where you get the answer of your call) use setTimeout : http://www.w3schools.com/jsref/met_win_settimeout.asp

setTimeout("document.getElementById('mydiv').innerHTML = ''",5000);
0
 
LVL 5

Expert Comment

by:amrish80
ID: 33539052
Hi
Use the time out function after the Ajax call...
0
 

Author Closing Comment

by:brad0525
ID: 33626758
Thank for the example
0
 
LVL 82

Expert Comment

by:leakim971
ID: 33626794
You're welcome! Thanks for the points!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now