ASP Hosting sale!
Double disk space and transfer for FREE!
Limited time offer! Act Now!

aspdev | articles | tutorials | forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to pass database value from ASP to JS?

 
Post new topic   Reply to topic    ASPdev.org Forum Index -> ASP programming
View previous topic :: View next topic  
Author Message
Rich



Joined: 18 Oct 2004
Posts: 4

PostPosted: Mon Oct 18, 2004 2:37 pm    Post subject: How to pass database value from ASP to JS? Reply with quote

Hi,

I have a JS function, but one of the values used within this function has to be extracted from a database on my server. How do I pass this value to my JS function, after I extract it in ASP?



Thanks

Rich
Back to top
View user's profile Send private message
administrator
Site Admin


Joined: 01 Oct 2004
Posts: 183

PostPosted: Mon Oct 18, 2004 4:02 pm    Post subject: Reply with quote

You can mix client-side JavaScript code with server-side ASP/VBscript code. Consider the following example:

Code:

<script>

function ShowDbValue(){
    alert("<%=Your_ASP_Value_Goes_Here%>");
}

</script>

_________________
Peter
ASP & ASP.NET Articles and Tutorials
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ASPdev.org Forum Index -> ASP programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group

SQL Tutorial