Check for an element in the page

Use this board to ask questions or have discussions with other Genie users.
Post Reply
rmarsh
Profound User
Posts: 56
Joined: Tue Jan 20, 2015 4:28 pm
First Name: Raymond
Last Name: Marsh
Company Name: Cracker Barrel Old Country Sto
Phone: 615-235-4215
Address 1: PO Box 787
City: Lebanon
State / Province: Tennessee
Zip / Postal Code: 37088
Country: United States
Contact:

Check for an element in the page

Post by rmarsh »

Is there a way to check if an element has been loaded?

I am extracting text from elements to use in a text box, however, the element is not always loaded and when it is not I am getting an error "D_2_2 is not defined."
User avatar
Alex
Profound Logic Staff Member
Posts: 233
Joined: Fri Jan 04, 2008 12:10 pm
First Name: Alex
Last Name: Roytman
Company Name: Profound Logic Software
Contact:

Re: Check for an element in the page

Post by Alex »

Something like this could do it...

Code: Select all

if (getObj("D_2_2") != null) {  // see if element exists
  // do something with element
}
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests