Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 extjs 4 制作一个电子邮件表单,一次向 12000 名公司成员发送电子邮件。
服务器一次不会容纳那么多,所以我尝试编写一个函数,每三个消息或其他东西生成发送方法。
有人知道合适的功能吗?示例代码?或者每隔几秒/分钟/等刷新一个 extjs 表单的方法?
不确定这是最好的方法。但是对于刷新页面,它是基本的 javascript
document.location.reload(true)
并使用 asetTimeout重复重新加载。
setTimeout
所以 5 秒后重新加载:
var t = setTimeout(function(){document.location.reload(true)}, 5000);
但我宁愿建议使用ajax 调用和 asetInterval每隔 x 毫秒重复一次,这样你就不必重新加载任何页面了!
setInterval
更简洁的方法是在后端处理它。
另一篇有用的文章