I've been facing issues running a JavaScript program on my online server. I'm considering another approach:
Using Ajax WebMethod with JavaScript calls:
<script type="text/javascript">
function gettime(){
var hour = new Date().getHours();
document.getElementById("hr")=hour;
}
</script>
ASP.net 4.0:
<WebMethod(EnableSession:=True)> _
Public Function HourFromJavascript() As Integer
printhour='hr from gettime
End Function