addloadevent is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2017 02:55 AM
Hi All,
I want to display some alert message to user, when they are about to take survey from survey masters.
for that i need to call a client side script in "survey_take" UI page while it is loading.
So i have added below
addLoadEvent( function() { |
onLoadFunction();
});
function onLoadFunction() |
{
alert("hi"); | |
//document.getElementById("myP").style.visibility = "hidden"; |
}
but it is not working and if i do inspect element then in that it is commenting the code?
Please help me to solve this issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2017 03:00 AM
Add your code in client script section of ui page and don't use script tag.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2017 03:14 AM
I placed the function in scruipt tag and called it from body
like
<body onLoad="functionname()"> and it worked
but it is
actually my requirement is to hide some data placed on the UI page, that's why i want to make the client script works after the form loads but it is not hiding elements
Please help me on this
Thanks and regards
Swamy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2017 03:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-12-2018 07:48 AM
Hi Swamy,
Which version you are using?
Is it working fine?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader