I am getting cross-site Scripting: DOM critical issue. Please can anyone help with the alternateway of using document.write
<script>
document.write('<base href=“' + document.location + '” />');
</script>
You can use following to prevent DOM XSS:
<body>
<script>
document.body.innerHTML='<base href="' + encodeURI(document.location) + '" />';
</script>
</body>