TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mehul Prajapati
NA
1.3k
45.9k
Wait until another thread is working in jQuery
Jan 2 2018 12:38 AM
Here, I am waiting for html button element from the popup iframe window. When a popup is open then my block of code will fire the click event on time and it's working fine, but my query is wanting to wait until not get button.
I have used the nested function calling with timeout thread, so when I call then work, but don't wait and go to the next task.
setPrint();
function
setPrint() {
setTimeout(
function
() {
var
btnprint =
null
;
var
frame = $(
'#WindowFadeiFrame'
).get(0).contentDocument;
var
btn = $(
'#btn'
, frame);
if
(btn.length == 0) {
btnprint ==
null
console.log(
'not found'
);
}
else
{
btn.click();
btnprint = btn;
console.log(
'found now'
);
}
if
(btnprint ==
null
) {
setPrint(); }
}, 100);
}
Reply
Answers (
3
)
Array in jquery
datepicker is not showing with datetime.