
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2017 08:39 AM
I have the following code to make it so that I could use HTML in the help text. This is in an on load script that is in the catalog item client scripts. How can I get this to work in the new Service Portal?
function onLoad() {
//Type appropriate comment here, and begin script below
$$("div.sc-help-text").each(function(item){
var textValue = item.innerText;
$(item).update(textValue);
});
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2017 04:36 AM
Hi Brian,
I checked this issue and found that the problem was with the page load time so I added timeout function which will get execute after 1.5 seconds.
Please find below updated script :
function($timeout) {
/* widget controller */
var c = this;
$timeout(function() {
jQuery('p.help-block').each(function() {
jQuery(this).html(jQuery(this).text());
});
}, 1500, false);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2017 01:07 PM
First place I would look at is to put it in the widget displaying the items instead.
//Göran

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2017 04:16 AM
Can you provide more details on how would go about doing that?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2017 11:45 AM
Hello Goran,
I was looking and figured out what page it goes to. It does not seem to be any specific widget that displays the catalog item.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2017 12:03 PM
Hi Brian,
I hope you are already aware about side effects of DOM manipulation
-Here is one solution which you can try :
Create new widget and write below DOM manipulation script in client controller :
function() {
/* widget controller */
var c = this;
jQuery('p[title="More information"]').each(function() {
jQuery(this).html(jQuery(this).text());
});
}
and Add this widget in "sc_cat_item" page.
---
You can also add validation in new widget, if you want to run this script for only specific catalog item/s :
For example:
by adding - if($sp.getParameter('sys_id') == "SYS_ID of catalog item") in server side script