473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Dynamic Include files

Hi All

I want to include javascript files based on the user location which I store
in a session variable upon user login.

The original code was like this

<SCRIPT language=JavaScript src="test_files/calcholidays.js"></SCRIPT>

We have multipe Javascript Script files and want to use the correct one
based on the Location Variable.

The variable is sLocation = Session("Location")

We would like the include file to look something like this

<SCRIPT language=JavaScript src="test_files/" & <%= sLocation %> &
".js"></SCRIPT>

Not sure how to write this.

Can someone please help
Jul 22 '05 #1
4 2253
JP SIngh wrote on 15 nov 2004 in
microsoft.public.inetserver.asp.general:
I want to include javascript files based on the user location which I
store in a session variable upon user login.

The original code was like this

<SCRIPT language=JavaScript src="test_files/calcholidays.js"></SCRIPT>

We have multipe Javascript Script files and want to use the correct
one based on the Location Variable.

The variable is sLocation = Session("Location")

We would like the include file to look something like this

<SCRIPT language=JavaScript src="test_files/" & <%= sLocation %> &
".js"></SCRIPT>

Not sure how to write this.

Can someone please help


Please next time start with:

Did you try this out?
Did you look at the rendered source in your browser?
Was it succesfull? If not, dit you get an error [what error]?

==================

Try, after analyzing the differences with your code:

<SCRIPT type="text/javascript"
src="test_files/<% =Session("Location") %>.js">
</SCRIPT>

And inspect the rendered html again.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

Jul 22 '05 #2
Yes I did try it out sir but it did not work.

I don't know the syntax hence my question.

Thanks you
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
JP SIngh wrote on 15 nov 2004 in
microsoft.public.inetserver.asp.general:
I want to include javascript files based on the user location which I
store in a session variable upon user login.

The original code was like this

<SCRIPT language=JavaScript src="test_files/calcholidays.js"></SCRIPT>

We have multipe Javascript Script files and want to use the correct
one based on the Location Variable.

The variable is sLocation = Session("Location")

We would like the include file to look something like this

<SCRIPT language=JavaScript src="test_files/" & <%= sLocation %> &
".js"></SCRIPT>

Not sure how to write this.

Can someone please help


Please next time start with:

Did you try this out?
Did you look at the rendered source in your browser?
Was it succesfull? If not, dit you get an error [what error]?

==================

Try, after analyzing the differences with your code:

<SCRIPT type="text/javascript"
src="test_files/<% =Session("Location") %>.js">
</SCRIPT>

And inspect the rendered html again.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

Jul 22 '05 #3
JP SIngh wrote:
Hi All

I want to include javascript files based on the user location which I
store in a session variable upon user login.

The original code was like this

<SCRIPT language=JavaScript src="test_files/calcholidays.js"></SCRIPT>

We have multipe Javascript Script files and want to use the correct
one based on the Location Variable.

The variable is sLocation = Session("Location")

We would like the include file to look something like this

<SCRIPT language=JavaScript src="test_files/" & <%= sLocation %> &
".js"></SCRIPT>

Not sure how to write this.

To start with: don't use a vbscript concatenation expression when you've
specified the language to be javascript. Use +, not &.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #4
> <SCRIPT language=JavaScript src="test_files/" & <%= sLocation %> &
".js"></SCRIPT>

Maybe you meant:

<SCRIPT language=JavaScript src="test_files/<%= sLocation %>.js"></SCRIPT>

--
http://www.aspfaq.com/
(Reverse address to reply.)
Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Daniel Keller | last post by:
Hello! I'm trying to set up a page system using "dynamic" SSI. That means that I normally use the following on my website: <!--#include virtual="file.inc" --> Now I want to make this...
6
by: Materialised | last post by:
Hi Everyone, I apologise if this is covered in the FAQ, I did look, but nothing actually stood out to me as being relative to my subject. I want to create a 2 dimensional array, a 'array of...
0
by: Pascal Costanza | last post by:
Dynamic Languages Day @ Vrije Universiteit Brussel ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Monday, February 13, 2006, VUB Campus Etterbeek The VUB (Programming Technology Lab,...
1
by: James Bates | last post by:
Hope someone can help me out with something - I'm a HTML/CSS developer who know's a little PHP, which I use to make smaller sites semi-dynamic, I want to expand on what i'm currently doing but need...
1
by: foker | last post by:
I have a file with a list of times in it in the form hh:mm:ss. The file starts with a single INT like 460. That int is the number of times in the file so I can size my dynamic array correctly. I...
23
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these...
4
by: pratap | last post by:
Is there any way in which one can link a.so(Class implementation by Vendor A in a dynamic library) and b.so(Class implementation by Vendor A in a dynamic library) and use it in 1.cpp where 1.cpp...
2
by: thetechturf.com | last post by:
I have some simple dynamic content pages (included below). I need to know how to add specific meta tags (ie. description, keywords, ect.), as well as extra specific header coding to a page. I would...
21
by: karen987 | last post by:
I have a news website, with asp pages. It has publishing software which allows you to add articles in a database, and then calls them up from links etc. I have added dynamic meta tags in 2 parts. The...
7
by: Ajinkya | last post by:
I have writen a program for a game called game.exe Now it includes a player part to which has to be a function to be writen by someone else. Now I want to provide this exe to some tester who...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.