<< Click to Display Table of Contents >> Navigation: Components > ciDOMStrInjector |
The ciDOMStrInjector allows an easy way to inject strings in your program at run-time with unique useful features. The main reason for this component so far is to Inject JavaScript in use with uniGUI frameworkt to pass code to a browser or DOM elements in HTML code at run time.
This component is platform dependent and is related to uniGUI framework only. This component is a mix between ciMacroStrInjector and ciFileStrInjector. They have the same properties and methods, hence no need to repeat prior topic content here.
fig 1- ciDOMStrInjector in Object Inspector.
The main purpose of this component is to insert JavaScript or HTML code in a uniGUI session related to a browser instance or DOM element, hence the name. Is the same as unisession.addjs() procedure but with macro substitution and file handling. Therefore it gives great possibilities to improve projects using uniGUI.
But the diference is at the procedure InjectJS and InjectJSN. Similar to ExpandMacros is ciMacroStrInjector, (that still works the same way here), this component can do the macro substitution and at the same time Inject the code.
InjectJS: Injects the code doing a regular macro substitution.
InjectJSN: Similar to uniGUI sintaxe, Injects the code but does NOT the macro substitution.
InjectJSN( 'code'): Injects direct code without any macro substitution but ignoring the code in Strings property functioning as a direct command.
See animation below:
With the direct format injection, your code would look like this: