I need get a variable value from XSLT in search result in SharePoint 2010. But this value is muti-lines text. When I add this variable value in JavaScript, the JS code cannot work, because the line break. How can I remove line break from text ? Or remove them directely in XSLT ?
<!DOCTYPE html>
<html>
<body>
<p>Click the button to convert different objects to strings.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x1 = '<xsl:value-of select="$information"/>';
//The contents of this variable value
'To submit your request, plase contact Mr XX
HR request (for HR only!!!)
Warning : Offre available for people working in HR
This request allows you to modify your account name.
Thank you';
//End of contents
var res = String(x1);
document.getElementById("demo").innerHTML = res;
}
</script>
</body>
</html>