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 

ASP to JavaScript

 
Post new topic   Reply to topic    ASPdev.org Forum Index -> JavaScript / DHTML / HTML / CSS
View previous topic :: View next topic  
Author Message
JohnV



Joined: 19 Nov 2004
Posts: 4

PostPosted: Tue Nov 30, 2004 1:41 pm    Post subject: ASP to JavaScript Reply with quote

Hi,

Can I pass a value from my server-side ASP code to a clien-side JavaScript function?



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


Joined: 01 Oct 2004
Posts: 183

PostPosted: Tue Nov 30, 2004 1:46 pm    Post subject: Reply with quote

Hey John,

Passing a value from ASP to JavaScript is very easy. I've already answered a similar to your question here:

http://www.aspdev.org/forums/viewtopic.php?p=54



Cheers,
_________________
Peter
ASP & ASP.NET Articles and Tutorials
Back to top
View user's profile Send private message
raven



Joined: 31 Jan 2006
Posts: 41

PostPosted: Wed Feb 01, 2006 2:07 am    Post subject: Reply with quote

ASP is unaware of Javascript and Javascript will accept ASP arguments as being hard-coded values by the time it interprets the code since it must be fully loaded and delivered to the browser.

so if you had a function foo:

Code:
function foo('<%=vASPVariable%>')
{
    //do something
}


and the variant vASPVariable was equal to 1 the function would read it as such.
_________________
Programmers do it in code
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ASPdev.org Forum Index -> JavaScript / DHTML / HTML / CSS 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