Solved

clear div 5 seconds after ajax returns value

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
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 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…

930 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

11 Experts available now in Live!

Get 1:1 Help Now