javascript in the container - Forum

Forum Navigation
You need to log in to create posts and topics.

javascript in the container

Hi everybody. After reinstalling VisualNeoWeb, there was a problem, javascript placed in the container component between the <script></script> tags does not work and stops the execution of scripts on the page. What could be the problem?
Moreover, it's not about the correctness of the script itself, the problem also occurs, even if nothing is written between the <script></script> tags. The problem also remains in the new project with only one container and the <script> tag. JavaScript hosted in custom Metadata or in plugins works.
Thanks!

@alexander_loc I can add this code to a new project Container HTML with no problems. Note that the JavaScript will be executed at design time too:

<script>alert("hi");</script>

Regards.

@luishp If I insert this script into the container, the message "hi" appears, but everything else stops working (button scripts, page transitions, etc.)

@alexander_loc you are right, I have reproduced the problem... but why are you including a script tag into a Container object? It shouldn't be necessary unless you want to interact with objects at design time, and that could create a lot of unexpected behaviors.

alexander_loc has reacted to this post.
alexander_loc

@luishp it seemed to me that this worked in the previous version, maybe I'm wrong. In any case, thanks for the feedback, I will use a different approach for javascript

@alexander_loc note that you can use BeginJS and EndJS and include whatever JavaScript code you need instead of NeoScript.
You can also include your own tags into: Project > Properties > Advanced > Custom Metadata

Regards.