- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2023 09:02 AM
Hi All,
can anyone guide me how can we pass variable from client side to HTML in UI Pages?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2023 01:01 AM
So, if the reason for why you want to get the contents of the <p/> element is to remove the HTML tags, that is not how it should be done.
You just need to enclose the phase 1 interpolation (${...}) within a <g:no_escape/> tag:
<p><g:no_escape>${ content }</g:no_escape></p>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2023 05:04 AM
You're welcome! 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2023 09:54 AM
For example you html contains this tag:
<div id="myID"></div>
if you want to set something in HTML tag please use the dom operation.
document.getElementById('myID').innerHTML = '<h1>Please mark my answer correct</h1>';
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2023 10:48 AM
UI Action:
function onClick() {
var dialog = new GlideModal('my_ui_page');
dialog.setPreference('my_custom_variable', 'my_value');
dialog.render();
}
UI Page (Client Script):
addLoadEvent(function() {
var gdw = GlideDialogWindow.get();
var myValue = gdw.getPreference('my_custom_variable');
alert(myValue);
});