HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 3rd, 2003, 02:29 AM
Psaxtiris Psaxtiris is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Athens - Greece
Posts: 41 Psaxtiris User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
reading asp variables from javascript

is there a way to pass a variable from an asp page to a function included in js file??
__________________
I was born upon the sky
where the wind flew free
and there was nothing
to stop the light of the sun...

Reply With Quote
  #2  
Old October 6th, 2003, 06:52 PM
sirussirus sirussirus is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Québec
Posts: 27 sirussirus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Yes

You can just pass the value of the variable not the variable itself.

You just have to make a your function in javascript with a paramètre like

function showVariableValue(strVariableValue)
{
alert(strVariableValue);
}


And Call it like

Response.Write "<script language= ""javascript"">"
Response.Write "showVariableValue(" & Your Variable & ")</script>"

Reply With Quote
  #3  
Old December 9th, 2003, 09:23 AM
frankcow's Avatar
frankcow frankcow is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: http://www.justin-cook.com
Posts: 133 frankcow User rank is Private First Class (20 - 50 Reputation Level)frankcow User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 h 34 m 16 sec
Reputation Power: 5
or you just do this:

function somethingOrOther () {
var firstvar = <%= varOne %>
var lastvar = <% varOneMillion %>

}

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > reading asp variables from javascript


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway