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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Importing javascript into personalization block

kattyice
Level 2
Level 2

Hi there,

 

I have a question of how to import javascript that I have in the Adobe Campaign Classic to my personalization block. I tried to use "<%@ include file='javascriptTest' %>" to import, but the default pickup path seems not correct. So I am asking what is the standard path of the javascript path on the server for Adobe Campaign? (The path on the server which holds AC in our company is like ......./neolane/nl6/var/.....).

 

Or If I can not import the javascript from the file including method above, which way can I use to import a js as a library to our personalization block? Thank you 🙂

1 Accepted Solution
Jonathon_wodnicki
Correct answer by
Community Advisor
Community Advisor

Hi,

 

You can't import js into personalization blocks, not the normal way. You can:

  • Include another personalization block that has js
  • Include the js using the personalization tab of the delivery along with eval(@jsData) in your personalization block

 

Thanks,

-Jon

View solution in original post

3 Replies
Jonathon_wodnicki
Correct answer by
Community Advisor
Community Advisor

Hi,

 

You can't import js into personalization blocks, not the normal way. You can:

  • Include another personalization block that has js
  • Include the js using the personalization tab of the delivery along with eval(@jsData) in your personalization block

 

Thanks,

-Jon

View solution in original post

kattyice
Level 2
Level 2
Hi, John, thx for the response, its useful. But I have a question of how to use the eval(@jsData) that you mentioned? Could you give sth like an example? I will really appreciate that, thank you ! 🙂
Jonathon_wodnicki
Community Advisor
Community Advisor
Sorry, it's js.data, which is the xpath for 'js' or whichever name is given to the js in the wizard. For the rest, object schema is xtk:javascript, table is no, path is /
kattyice
Level 2
Level 2
Hmm, so do you mean the Xpath of a js file in the schema? (Since the js files are stored in a table). Lets assume we have a js file which is called "test" in the xtk:javascript table, what the Xpath would be and be called from eval(js.data) ?