Expand my Community achievements bar.

Adobe Campaign User Groups are live now. Join our Adobe Campaign User Groups and connect with your local leaders!
SOLVED

Importing javascript into personalization block

Avatar

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

Avatar

Correct answer by
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

4 Replies

Avatar

Correct answer by
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

Avatar

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 !

Avatar

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 /

Avatar

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) ?