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

createElement - document.createElement is not a function.

Avatar

Avatar
Validate 1
Level 2
szymons55769873
Level 2

Likes

5 likes

Total Posts

22 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Give Back
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
szymons55769873
Level 2

Likes

5 likes

Total Posts

22 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Give Back
Boost 5
Boost 3
Boost 1
View profile
szymons55769873
Level 2

25-02-2019

Hi

I'm trying to use the following method in my workflow, in JS activity: createElement

When I start the workflow and check the logs I get the error: document.createElement is not a function.

How do I use it?

I'm trying to scan certain deliveries, within their HTML source code, for all the links and check the HTTP Response of them before starting the delivery.

I need to create a DOM in order to use it later with querySelectorAll

         

var doc = [];

doc = document.createElement("div");
doc
.innerHTML = fromDB; //getting the HTML source from the DB
doc
.querySelectorAll("a[href]")...

Replies

Avatar

Avatar
Give Back 5
Employee
ramon_bisswange
Employee

Likes

242 likes

Total Posts

353 posts

Correct Reply

182 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 25
Give Back 10
Give Back
View profile

Avatar
Give Back 5
Employee
ramon_bisswange
Employee

Likes

242 likes

Total Posts

353 posts

Correct Reply

182 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 25
Give Back 10
Give Back
View profile
ramon_bisswange
Employee

25-02-2019

Hi,

please check to post in the Campaign Classic forum for such topic.

Campaign Standard does not have the JS activity so people there might not help.

If you use the default JS activity, it won't be in a document scope.

createElement needs a DOMDocument instance for being able to work.

So please check the constructor call to initialize a new DOMDocument first: DOMDocument

Then the function should be available on the created object

Avatar

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct Reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Validate 1
MVP
Jean-Serge_Biro
MVP

Likes

353 likes

Total Posts

464 posts

Correct Reply

153 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile
Jean-Serge_Biro
MVP

25-02-2019

Hi szymons,

As replied in this post:

Scan HTML content for URLs and cURL them

it is better/easier to achieve the same by using JS activity with queryDef or Query activity with the table (schema) nms:trackingUrl.

Regards
J-Serge