Darren Cook
Darren Cook

Reputation: 721

Passing Vbscript to Javascript

I'm using VbScript to get the current hour from the server, then want to pass it to a JavaScript function as shown below. Can you please advise as to the correct way to write this.

<%
Dim currentHour
currentHour = Hour(Now)
%>

<script type="text/javascript">
$(function() {       
var dd = 0
var dsc = ('"&currentHour&"');
if (dsc > 4) {
dd = dd + 1; // go one day in the future
}
</script>

Thanks

Upvotes: 2

Views: 838

Answers (1)

Rubens Farias
Rubens Farias

Reputation: 57936

var dsc = ('<%= currentHour %>');

Upvotes: 4

Related Questions