History & Introduction
However, with the introduction of c2_callFunction in C2 version 175, integration of custom JS codes with C2 is never been that easier.
So, I decided to share how we can easily bridge calls between JS codes and C2's Function.
Here you will learn, how we can do a two-ways communication (from C2 to JS and JS to C2) and the usage.
c2_callFunction("C2 Function Name", ParameterArray)
c2_callFunction("UpdateText", ["Updated From Browser!"]);
JS <--> C2 Example
Real Life Usage Example
There are a ton of useful and well-tested JS scripts out there which we can just use them. In this example, we will try to remove HTML tags from a text. To implement this logic and function in C2, we might need to create a complex eventsheet or create a plugin of our own. However, by using c2_callFunction, we can just have the functionality with a few lines of code.
Check intex.html and look for this script.
This is my FIRST tutorial and hope it's helpful and useful!