Print Page | Close Window

asp var to js var

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=12528
Printed Date: 30 March 2026 at 11:31pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: asp var to js var
Posted By: asp what that??
Subject: asp var to js var
Date Posted: 13 November 2004 at 4:40pm
i am trying to get a asp variable to going to js....could someone help me with this?



Replies:
Posted By: Mart
Date Posted: 13 November 2004 at 4:44pm
What do you mean? js and asp do not declare variables as types so they should be able to be set as the same value


Posted By: Gullanian
Date Posted: 13 November 2004 at 4:53pm
I think you mean passing values from an ASP page into a Java applet?


Posted By: asp what that??
Date Posted: 13 November 2004 at 5:16pm
its not a applet its just a script...ok its like this....i want to take the users id which is a asp var....and i need to plug that into a js that i am using for a menu :)


Posted By: Mart
Date Posted: 13 November 2004 at 5:22pm
<script language="javascript">
function myFunction(var1)
{
var userId;
userId = '<%= UserId %>';
}
</script>

Where UserId is the variable or function


Posted By: asp what that??
Date Posted: 13 November 2004 at 5:24pm

see i had something kinda like that but how do i plug it into where i need it now...this is what i have now

aI("text=Home Page;url=../default.asp;");

but where it says default i need it to be the var

thaks for the help



Posted By: Mart
Date Posted: 13 November 2004 at 5:33pm
firstly you should use single quotes with javascript, but this should work:

aI('text=Home Page;url=<%= YourVar %>;');


Posted By: asp what that??
Date Posted: 13 November 2004 at 5:35pm
THANK YOU!!!!  



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net