forked from ServiceNowDevProgram/code-snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
18 lines (15 loc) · 950 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function onLoad() {
var message = '';
message += 'This is an expanding info message. It can even run code! Click "Show more" to see!';
message += '<div>';
message += '<p><a href="#" onclick="javascript: jQuery(this.parentNode).next().toggle(200);">Show more</a></p>';
message += '<div style="display: none;">';
message += '<ul style="list-style: none">';
message += '<li>This is the expanded info in the message.</li>';
message += '<li>You can include any details you like here, including info retreived from a script like the sys_id of the current record: ' + g_form.getUniqueValue() + '</li>';
message += '</ul>';
message += '<p>You can even run a script when an element is clicked <a href="#" onclick="javascript: alert(\'See?\');">like this</a>. You just have to escape your code in the HTML.</p>';
message += '</div>';
message += '</div>';
g_form.addInfoMessage(message);
}