Actually there we are defining the pagename variable, which is in runtime getting assigned with values containing script tags and all other html fragments inside the variable for example: var pagename= ‘ <script> </script> …. HTML Fragments.’
Pega did not give this solution. The SR described how to set a clipboard page property to a variable in an external JS file.
This post describes another set of custom JS to call a decision table form UserWorkForm which is now causing ruleforms to not load properly.
I think you should take a few steps back here to describe exactly what sort of business requirement you are trying to achieve which has led you down this approach? We may be able to offer some better alternatives here.