weixin_33744854 2011-01-11 21:23 采纳率: 0%
浏览 38

滚动AJAX代码问题

I've been looking for some kind of tutorial/info about how to create a very simple horizontal scrolling AJAX Ticker that pulls text to display from a MySQL database, however the only information I can find is very limited and not related to database stuff, it only reads from text files.

Does anyone know how to do this, or knoww of any good resources about this?

Thanks!

  • 写回答

1条回答 默认 最新

  • weixin_33709219 2011-01-11 21:30
    关注

    This is a pretty broad question, but your solution will end up looking something like this:

    1. Have a server somewhere that your JavaScript will hit (via AJAX) to retrieve the data you intend to 'tick'.
    2. Write some simple PHP or whatever to serve up the data, formatted as you'd like, and place it on the server mentioned in step 1.
    3. Write your JavaScript to access the server at a given interval using setTimeout or setInterval, process the results and add them to whatever data structure powers the ticker.
    4. Build your HTML to contain the ticker and wire it up to one of the many jQuery plugins available that will let you do the ticker bit*

    *Yes, I realize you didn't specifically mention jQuery in your question. If you're using a different framework, Google that one instead. Point is, you should almost certainly use some type of framework for this, IMO.

    If you have more specific implementation questions, fire away. Good luck!

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog