In my project JS is required, so I've added the code below at base layout _Layout
. But sometimes the message is visible (blinks in the back) while browser rendering.
Any suggestion on how to work better with this message?
The original idea on how to get message if JavaScript disabled is from here: https://stackoverflow.com/a/2170503/19210262
<html>
<head>
</head>
<body class="fixed-left">
<div id="warningJS" style="display: block;">
<table style="width: 100%; height: 60vh;">
<tr>
<td align="center" valign="middle">
<h4>Error: please enable JavaScript</h4>
</td>
</tr>
</table>
</div>
<div id="totalBody" style="display:none;">
//Code here
</div>
<script type="text/javascript">
let totalBody = document.getElementById('totalBody');
let warningJS = document.getElementById('warningJS');
totalBody.style.display = 'block';
warningJS.style.display = 'none';
</script>
</body>
</html>