getElementById

Avatar

Avatar
Validate 1
Level 2
andreab24032044
Level 2

Likes

5 likes

Total Posts

6 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
andreab24032044
Level 2

Likes

5 likes

Total Posts

6 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 1
View profile
andreab24032044
Level 2

25-04-2018

Hello,

I am trying to use the document.getElementByID method and it is throwing an error while evaluating the script

Capture.JPG

Is there an alternative Adobe Campaign method that would work the same way?

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Springboard
MVP
MarcelSzimonisz
MVP

Likes

102 likes

Total Posts

226 posts

Correct reply

56 solutions
Top badges earned
Springboard
Establish
Contributor
Give Back 25
Give Back 10
View profile

Avatar
Springboard
MVP
MarcelSzimonisz
MVP

Likes

102 likes

Total Posts

226 posts

Correct reply

56 solutions
Top badges earned
Springboard
Establish
Contributor
Give Back 25
Give Back 10
View profile
MarcelSzimonisz
MVP

27-04-2018

Hello, if  are you trying to change email content before personalization you can use regular expressions  eg.

var html = delivery.content.html.source;

var regex = new RegExp("</body></html>","ig");

var regex2 = newRegExp("<div id=\"your_id\">(.*?)<\/div>","ig");

html.replace(regex,'add_your_html');

html.replace(regex2,'add_your_html');

delivery.content.html.source = html;

OR you can try to amend html with  XML  E4X extension look it up in jsapi (have not tried).

Marcel

Answers (2)

Answers (2)

Avatar

Avatar
Validate 1
Level 2
andreab24032044
Level 2

Likes

5 likes

Total Posts

6 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
andreab24032044
Level 2

Likes

5 likes

Total Posts

6 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 1
View profile
andreab24032044
Level 2

07-05-2018

Many thanks, I ended up following a very similar approach

Avatar

Avatar
Validate 1
Level 3
kapilsharma0101
Level 3

Likes

14 likes

Total Posts

52 posts

Correct reply

18 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back 10
Give Back
View profile

Avatar
Validate 1
Level 3
kapilsharma0101
Level 3

Likes

14 likes

Total Posts

52 posts

Correct reply

18 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back 10
Give Back
View profile
kapilsharma0101
Level 3

26-04-2018

Hi,


Can you please elaborate a little bit about the issue, and what exactly you are trying to achieve ?