Solved

clear div 5 seconds after ajax returns value

Posted on 2010-08-26
4
386 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

856 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