我试图找到某种办法,在某个时候停止某项职能,直到某个时候不再有特定类别。 我不能改变这一类别被分配和删除的地方,因为它是一片gin。
我正在考虑这样做。
function DoSomething() {
while ($( div.divControl ).hasClass( playing ))
{
//Wait here
}
};
这是正确的道路吗?
我试图找到某种办法,在某个时候停止某项职能,直到某个时候不再有特定类别。 我不能改变这一类别被分配和删除的地方,因为它是一片gin。
我正在考虑这样做。
function DoSomething() {
while ($( div.divControl ).hasClass( playing ))
{
//Wait here
}
};
这是正确的道路吗?
This will block so the element will never be changed, as no other code will execute. What you need to use is an interval:
var interval = setInterval(DoSomething, 500);
function DoSomething() {
if ($( div.divControl ).hasClass( playing ))
{
// Do something
clearInterval(interval);
}
};
这将每半年执行一次职能。 间隔期将在职能成功后取消。
更不用说,这只会使浏览器陷入无限的循环。
您的最好礼仪(因为我可以随时思考),就是对这项职能进行规定,并检查你们的遗体是否仍然拥有第二季度的班级。
但是,根本不是冰,吗?
How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.
I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...
Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...
Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...
I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...
Is it possible for someone to give me a few pointers on how to display a multidimensional array in the form of a bar graph? The array is multidimensional, with three elements in each part - and the ...
Is it possible to reload a form after file-input change? I have a form where the user can chose an image for upload. I also have a php script which displays that image resized. I only wonder if it ...
I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.