In my case the script terminates before the html page is displayed at all. Therefore, it has no access to the HTML DOM and cannot update elements while a dialog is shown. It is a requirement.
But I need to create a table having dynamic rows and columns according to the various data , Im having
<html>
<body style="overflow:hidden;">
<?js
// here the js code must be.
// I have a json object array, I need to create a table to
//display these data. According to the size the table rows and
//columns must be changed.
?>
<!--Body div has autogenerated id.Please do not delete it. -->
<div id="bodydiv" class="Blank" style="background-color:rgb(247, 247, 247); height: 100%; width: 100%;">
<!-- here the html page elements must be created -->
</div>
</body>
</html>