Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Profile Script - Element exists

Avatar

Avatar
Validate 1
Level 1
paul_anderson
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
paul_anderson
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
paul_anderson
Level 1

20-01-2016

I'm trying to create a profile script that checks to see if an element on the current page exists. If the element exists then the code returns true. I'm having difficulty getting my code to work without getting the "element undefined" error. Does anyone have any tips to get this script to work? If accessing page elements through the profile script is not possible; I'm wondering if there is a way to profile users through an offer? Any help is appreciated.

 

if (mbox.name == 'my_mbox'){ var hasClass = element.classList.contains('.mydiv'); if (hasClass === true) { return true; } }
View Entire Topic

Avatar

Avatar
Validate 1
Level 1
paul_anderson
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
paul_anderson
Level 1

Likes

0 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
paul_anderson
Level 1

05-02-2016

Thank you for the reply Rajneesh. I'm a bit confused on how I tie the offer code to the profile code. Can you please provide an example?