Tag Archives: Javascript

Reading Database value in Javascript

Today while developing a page, we felt need to read database into javascript array. And we were confused if at all we can do this. So finally after googling on this we found a workaround. So I just thought of sharing this with you because I think this is really helpful.

[code]<script language="JavaScript" type="text/javascript">
var allRecords = new array();
var count=0;
<%While (NOT rs_yours.EOF)%>
allrecords[count]="<%= rs_yours.Fields.Item("foo1").Value %>"

This script will read the value from your datareader into javascript array.

Also if you want to read a single value from the server side into your javascript like this,

[code]var location='<%=Session["location"]%>’;[/code]

Hope this helps 🙂

Chrome Experiments

We always use javascript only for some validation purpose or some other reason.I was amazed when I saw some of the coolest application which are developed in javascript. The applications I am talking about are chromeexperiments. Below is the link to browse chromeexperiments.