So I’m finally moving from Servoy 5 to 8!!
In 5 I have been using…
<html><a href="javascript:globals.myMethod()">ClickMe</a></html>
…to trigger methods from within HTML areas but these no longer seem to work. What is the best replacement for this code in 8?
Hi David,
By default Servoy doesn’t trust HTML like that anymore. You can make it trust that specific element by adding the following code to your onLoad event:
elements.NameOfElement.putClientProperty(APP_UI_PROPERTY.TRUST_DATA_AS_HTML, true);
Hope this helps.
Hi Robert,
That’s perfect - seems to work fine! Many thanks
Dave
When this TRUST_DATA_AS_HTML setting is used, make sure that all data in the html is static (like in your example) or from a source that cannot be modified by users, otherwise you would be vulnerable for a Cross-site scriping (XSS) attack.
Appreciate the advice Rob - thanks