Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to get data from the database using javascript

Status
Not open for further replies.

jermine

Programmer
Jun 15, 2001
59
SG
people say javascript is the same with ASP...
to me ASP is like english and javascript is a language from outer space...

i hope u guys can help me.

PROBLEM 1:
i need to get data from the database and pass it as a parameter to the next page.

i dont know how to do this.

PROBLEM 2:
how to get the value of the parameter from the previous page to pass it to a stored procedure.

my mind is stuck in ASP...
i really need your help
 
if you have an asp page that's pulling out some value that you want to have accessible to other pages later on, then one approach would be to use a cookie to store the value. on the other hand, if you have an asp page the pulls out some value and you want a javascript function that runs on the generated page to be able to use that value, you could have the asp create the javascript code for assigning the value.

for example, if "RS" is a recordset holding the database data...

Code:
<script>
<% response.write &quot;var someVariable = &quot; & RS(&quot;someValue&quot;) %>
....some javascript code which uses &quot;someVariable&quot;
</script>

to get data from a page back to a procedure on the asp page, i believe the primary options are to use a cookie again, pass the data through a form, or attach the info to the URL.

glenn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top