Jquery:类名多ajax请求
请帮我先做这个
我有这个div
<div class="loader" alt="stat.php">
Here i want to load static
</div>
<div class="loader" alt="notify.php">
Here i want to load notification
</div>
<div class="loader" alt="alert.php">
Here i want to load new messages
</div>
,我想这样做
我想用这个类=加载器
每1分钟加载一次并从它的alt中获取
这个div意味着
1分钟后我想制作foreach div
类=“加载器”
ajax 请求其替代页面 里面的
意思是每1分钟我希望每个div都像这样
<div class="loader" alt="stat.php">
Static loaded from stat.php
</div>
<div class="loader" alt="notify.php">
notification loaded from notify.php
</div>
<div class="loader" alt="alert.php">
messages loaded from alert.php
</div>
,每1分钟做这个请求???
我该怎么做
Please Help me to do this
first i have this div
<div class="loader" alt="stat.php">
Here i want to load static
</div>
<div class="loader" alt="notify.php">
Here i want to load notification
</div>
<div class="loader" alt="alert.php">
Here i want to load new messages
</div>
and i want to do this
i want to make this divs with this class = loader
load every 1 min and get from its alt
mean
after 1 minute i want to make foreach div
class="loader"
ajax request to its alt page
and inside it
mean every 1 minute i want every div to be like this
<div class="loader" alt="stat.php">
Static loaded from stat.php
</div>
<div class="loader" alt="notify.php">
notification loaded from notify.php
</div>
<div class="loader" alt="alert.php">
messages loaded from alert.php
</div>
and every 1 minute do this request ???
How can i do this
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
像这样
使用each方法通过类
loader
处理每个DOM元素,然后使用load()方法用从URL加载的HTML替换元素的内容。这里有关于 load() 的文档 和 关于each()的文档在这里
Something like this
Using the each method to process each DOM element with the class
loader
it then uses the load() method to replace the contents of the element with the HTML loaded from the URL.Docs on load() here and docs on each() here