on 05-04-2021 10:58 PM
I am trying to call external BOT from GUI using its HTML/script, this works fine but when i try to send information like userid in the header parameter it doesn't work. When i debugged the program and tried the same html string in browser it throws error "Uncaught SyntaxError: Unexpected token return". Can you please check and let me know what am i doing wring in appending this string.
<<Created dummy BOT so i wont expose my actual token>>
DATA(html_str) =
'<html>' &&
' <head>' &&
' <script>' &&
' window.webchatMethods = ' &&
' { getMemory: (conversationId) => { const memory = { userId: "E123456" }; ' &&
' return { memory, merge: true } } }' &&
' </script>' &&
' </head>' &&
' <body>' &&
' <script src= "https://cdn.cai.tools.sap/webchat/webchat.js" ' &&
' channelId="02b00be2-4fa1-435d-9650-e48e50831913" ' &&
' token="35bb6bbb74173f08e48ca51acc2b8740" ' &&
' id="cai-webchat" > ' &&
' </script>' &&
' </body>' &&
'</html>' .
cl_abap_browser=>show_html(
EXPORTING
html_string = html_str
* modal = modal
position = cl_abap_browser=>middle
title = title
buttons = cl_abap_browser=>navigate_html
format = cl_abap_browser=>portrait
size = cl_abap_browser=>small
* data_table = ext_data
IMPORTING
html_errors = error_list ).
Was able to resolve this issue after adapting the java script code to IE standards. Thanks for all the insights.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
73 | |
9 | |
8 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.