In my attempt to create a JavaScript link that, when clicked, assigns a value to a public render parameter in WebSphere Portal, I'm encountering unexpected code instead of the intended value.
Here is how I am constructing the link using JavaScript:
var a = document.createElement('a');
var linkText = document.createTextNode('Click here for more info');
a.appendChild(linkText);
a.title = 'Link title';
a.href = '[Plugin:RenderURL pr1.mode="set" pr1.type="public" pr1.key="data" pr1.value=' + JSON.parse(http.responseText).uniqueID + ']';
Upon inspecting with Firefox DevTools, this is what I see:
<a href="p0/IZ7_9O5CH940L8BE00AQSQ97LA0811=CZ6_9O5CH940LON880AAN4OSND00N6=MEsources!QCLQCAJSON.parse(http.responseText).uniqueIDQCAQCL==/#Z7_9O5CH940L8BE00AQSQ97LA0811" title="Link title">Click here for more info</a>
It appears to be an escaping issue, despite trying numerous variations. How can I properly construct the href attribute for my link?