call js function in the jssp | Community
Skip to main content
wankang
Level 3
Apr 23, 2023 2:22 PM UTC
Solved

call js function in the jssp

i create a cus:WechatApiService.jssp and wct:wechatApiService.js, in wct:wechatApiService.js defined a function 'graphExec',  and same business required at jssp, so i call 'graphExec' at jssp, it not able to called, 

 

 

at the header of jssp, i had import the js like below, it still not able to called.

 

 

<%@ page import="/nl/core/shared/nl.js"%>
<%
loadLibrary("wct:wechatApiService.js");
//required server-side dependencies
NL.ns('NL.API');
NL.require('/nl/core/shared/core.js')
.require('/nl/core/shared/json2.js')
.require('/wct/wechatApiService.js')
.require('/nl/core/jsspcontext.js');
....

....

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
akshaaga
akshaagaAccepted solution
Employee
Apr 23, 2023 4:44 PM UTC

@wankang ,

Based on the code provided, it looks like you are loading the wechatApiService.js file correctly using the loadLibrary() and NL.require() functions.

However, there could be other reasons why the 'graphExec' function is not being called successfully in the JSSP file. Here are a few things to check:

  1. Make sure that the 'graphExec' function is defined in the wechatApiService.js file and is being loaded correctly. You can verify this by adding a console.log() statement in the function and checking the browser console for output.
  2. Check that the function is being called correctly in the JSSP file. You can try calling the function with some test data to see if it returns the expected results.
  3. Check for any errors in the browser console or Adobe Campaign logs that could be causing the issue.

If none of the above suggestions resolve the issue, it may be helpful to provide more information about the specific error message or behavior that you are experiencing.

4 replies

akshaaga
akshaagaAccepted solution
Employee
Apr 23, 2023 4:44 PM UTC

@wankang ,

Based on the code provided, it looks like you are loading the wechatApiService.js file correctly using the loadLibrary() and NL.require() functions.

However, there could be other reasons why the 'graphExec' function is not being called successfully in the JSSP file. Here are a few things to check:

  1. Make sure that the 'graphExec' function is defined in the wechatApiService.js file and is being loaded correctly. You can verify this by adding a console.log() statement in the function and checking the browser console for output.
  2. Check that the function is being called correctly in the JSSP file. You can try calling the function with some test data to see if it returns the expected results.
  3. Check for any errors in the browser console or Adobe Campaign logs that could be causing the issue.

If none of the above suggestions resolve the issue, it may be helpful to provide more information about the specific error message or behavior that you are experiencing.

Translate
wankang
wankangAuthor
Level 3
Apr 24, 2023 6:56 AM UTC
browser output below issue.


JST-310000 Error while compiling script 'get_cus_WechatApiService_jssp' line 68: graphExec is not defined.

 

Translate