Sunday, April 2, 2023
Learning Code
  • Home
  • JavaScript
  • Java
  • Python
  • Swift
  • C++
  • C#
No Result
View All Result
  • Home
  • JavaScript
  • Java
  • Python
  • Swift
  • C++
  • C#
No Result
View All Result
Learning Code
No Result
View All Result
Home JavaScript

How to wait for the page to load before clicking in javascript? – JavaScript – SitePoint Forums

learningcode_x1mckf by learningcode_x1mckf
October 26, 2022
in JavaScript
0
Time limit for notify – JavaScript – SitePoint Forums
74
SHARES
1.2k
VIEWS
Share on FacebookShare on Twitter


You might also like

4 Packages for Working With Date and Time in JavaScript – MUO – MakeUseOf

Understanding the Power of Proxy in JavaScript – hackernoon.com

JavaScript vs. TypeScript: What's the difference? – TheServerSide.com

I need to manipulate an Intranet web site with Javascript and I’ve achieved the next capabilities which work nicely, but when I run them one after the other:

1: operate () 
var checklist = doc.getElementsByName("filter");
for (var i=0; i<checklist.size; i++) checklist[i].click on();
 ,

2: operate ()  
var checklist = doc.getElementsByClassName("ui-icon ui-icon-pencil tiptip");
for (var i=0; i<checklist.size; i++) checklist[i].click on(); 
 ,

3: operate ()  
for(var i = 0, len = doc.hyperlinks.size; i < len; i += 1) 
    if(doc.hyperlinks[i].textContent === "Configuration ") 
        doc.hyperlinks[i].click on();
    

 ,

4: operate ()  
var x = doc.getElementsByName("configurations[]");
    var i;
    for (i = 0; i < x.size; i++) 
        if (x[i].kind == "checkbox") 
            x[i].checked = true;
        
    
 ,

My aim is to launch all of the capabilities directly however I’ve to attend for the web page to load earlier than making the second click on then the third then the fourth.
with the next code I’ve to run my operate 4 occasions to get the 4 clicks

operate () 
//operate 1
var checklist = doc.getElementsByName("filter");
for (var i=0; i<checklist.size; i++) checklist[i].click on();
//operate 2
var checklist = doc.getElementsByClassName("ui-icon ui-icon-pencil tiptip");
for (var i=0; i<checklist.size; i++) checklist[i].click on();
//operate 3
for(var i = 0, len = doc.hyperlinks.size; i < len; i += 1) 
    if(doc.hyperlinks[i].textContent === "Configuration ") 
        doc.hyperlinks[i].click on();
    

//operate 4
var x = doc.getElementsByName("configurations[]");
    var i;
    for (i = 0; i < x.size; i++) 
        if (x[i].kind == "checkbox") 
            x[i].checked = true;
        
    
 
,

the strategy

`setTimeout(() => 
 var checklist = doc.getElementsByName("filter");
for (var i=0; i<checklist.size; i++) checklist[i].click on();
 , 3000)
setTimeout(() => 
 var checklist = doc.getElementsByClassName("ui-icon ui-icon-pencil tiptip");
for (var i=0; i<checklist.size; i++) checklist[i].click on();
 , 3000)`

and the strategy

doc.addEventListener("DOMContentLoaded", () => 
  var checklist = doc.getElementsByName("filter");
for (var i=0; i<checklist.size; i++) checklist[i].click on();
);
doc.addEventListener("DOMContentLoaded", () => 
  var checklist = doc.getElementsByClassName("ui-icon ui-icon-pencil tiptip");
for (var i=0; i<checklist.size; i++) checklist[i].click on();
);

Additionally don’t work, You probably have any concept please i shall be grateful.



Source link

Share30Tweet19
learningcode_x1mckf

learningcode_x1mckf

Recommended For You

4 Packages for Working With Date and Time in JavaScript – MUO – MakeUseOf

by learningcode_x1mckf
April 1, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

4 Packages for Working With Date and Time in JavaScript  MUO - MakeUseOf Source link

Read more

Understanding the Power of Proxy in JavaScript – hackernoon.com

by learningcode_x1mckf
April 1, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

Understanding the Power of Proxy in JavaScript  hackernoon.com Source link

Read more

JavaScript vs. TypeScript: What's the difference? – TheServerSide.com

by learningcode_x1mckf
April 1, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

JavaScript vs. TypeScript: What's the difference?  TheServerSide.com Source link

Read more

JetBrains updates IDEs for Java, JavaScript, Ruby – InfoWorld

by learningcode_x1mckf
March 31, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

JetBrains updates IDEs for Java, JavaScript, Ruby  InfoWorld Source link

Read more

Virtru Announces First Ever FIPS 140-2 Validated JavaScript … – GlobeNewswire

by learningcode_x1mckf
March 30, 2023
0
Google expands open source bounties, will soon support Javascript fuzzing too – ZDNet

Virtru Announces First Ever FIPS 140-2 Validated JavaScript ...  GlobeNewswire Source link

Read more
Next Post
The differences between Java and TypeScript devs must know

The differences between Java and TypeScript devs must know

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Related News

Time limit for notify – JavaScript – SitePoint Forums

Getting element value from iframe using jquery – JavaScript – SitePoint Forums

December 12, 2022
Typemock Simplifies .NET, C++ Unit Testing – The New Stack

Typemock Simplifies .NET, C++ Unit Testing – The New Stack

September 5, 2022
What’s a Python Namespace Package, and What’s It For? – Real Python

What’s a Python Namespace Package, and What’s It For? – Real Python

March 6, 2023

Browse by Category

  • C#
  • C++
  • Java
  • JavaScript
  • Python
  • Swift

RECENT POSTS

  • So why did they decide to call it Java? – InfoWorld
  • Senior Java Developer – IT-Online
  • 4 Packages for Working With Date and Time in JavaScript – MUO – MakeUseOf

CATEGORIES

  • C#
  • C++
  • Java
  • JavaScript
  • Python
  • Swift

© 2022 Copyright Learning Code

No Result
View All Result
  • Home
  • JavaScript
  • Java
  • Python
  • Swift
  • C++
  • C#

© 2022 Copyright Learning Code

Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?