开发者

Jquery display data on time interval

I am beginner to JQuery. I am preparing a test engine.. I want to display question with duration say 30 secs. each question h开发者_运维技巧ave to displayed 30 secs after that next question should be displayed this should be repeated till the last question. Can we do this with Ajax? waiting for ur reply... any ideas or suggestions


Yes, this can be done with Ajax:

  1. Fetch a question using an AJAX call like .load() AJAX queries with jQuery. Or you can load all questions in advance and just show the contents using the timer.
  2. Start a timer or use setTimeout("insert javascript here", timeout_in_milliseconds). Using search will provide you several jQuery timer plug-ins
  3. Repeat
  4. When all questions have been shown, exit.

Notice that you might want to store the value from setTimeout calls to a variable, if you want to cancel the timed event. For example, if you want a next question to be loaded right after the question is answered and you don't want the new question be replace by a rogue timed event.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜