473,397 Members | 1,960 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,397 software developers and data experts.

Javascript to read asp variable

Hi All,

Is it possible to read any ASP variable from a javascript file (.js) ?
Thanks
Prabhat
Oct 31 '05 #1
5 4804
Prabhat wrote on 31 okt 2005 in microsoft.public.inetserver.asp.general:
Is it possible to read any ASP variable from a javascript file (.js) ?


Call it an .asp file and use it as a .js. file.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Oct 31 '05 #2
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.242...

Call it an .asp file and use it as a .js. file.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)


Hi,

Actually I call the .js file from the home page like:
<script type='text/javascript' src='Scripts/MenuScript.js'></script>

So How can I proceed. I have the menu Links in the .js file (some of the
links are also points to other web sites). So I am updating the web site so
that where ever I have used the specific link (say: www.abc.com) that should
now read a ASP variable dynamically. I have 2 lines in the above .js file
and I want that 2 lines to read the same ASP variable. Hope you are able to
understand.

Thanks
Prabhat
Oct 31 '05 #3
Prabhat wrote on 31 okt 2005 in microsoft.public.inetserver.asp.general:
"Evertjan." <ex**************@interxnl.net> wrote in message

Call it an .asp file and use it as a .js. file.


Actually I call the .js file from the home page like:
<script type='text/javascript' src='Scripts/MenuScript.js'></script>


Don't.

If you want to use lines in that file like this:

var blahClientside = '<% =blahServersideVBSorJS %>';

use:

<script type='text/javascript' src='Scripts/MenuScript.asp'></script>


--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Oct 31 '05 #4
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.242...
Prabhat wrote on 31 okt 2005 in microsoft.public.inetserver.asp.general:
"Evertjan." <ex**************@interxnl.net> wrote in message

Call it an .asp file and use it as a .js. file.


Actually I call the .js file from the home page like:
<script type='text/javascript' src='Scripts/MenuScript.js'></script>


Don't.

If you want to use lines in that file like this:

var blahClientside = '<% =blahServersideVBSorJS %>';

use:

<script type='text/javascript' src='Scripts/MenuScript.asp'></script>


--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)


Hi

You want me to change the "MenuScript.js" file to "MenuScript.asp" and
Include the line I wanted to use in javascript file?

and then:
I will use the below line in my home page ("default.htm")?
<script type='text/javascript' src='Scripts/MenuScript.asp'></script>

But if so will the "script type='text/javascript' " still work ?

Thanks
Prabhat
Oct 31 '05 #5
Prabhat wrote on 31 okt 2005 in microsoft.public.inetserver.asp.general:
"Evertjan." <ex**************@interxnl.net> wrote in message
Prabhat wrote on 31 okt 2005 in
> "Evertjan." <ex**************@interxnl.net> wrote in message
>>
>> Call it an .asp file and use it as a .js. file.
>
> Actually I call the .js file from the home page like:
> <script type='text/javascript' src='Scripts/MenuScript.js'></script>


Don't.

If you want to use lines in that file like this:
var blahClientside = '<% =blahServersideVBSorJS %>';
use:
<script type='text/javascript' src='Scripts/MenuScript.asp'></script>


You want me to change the "MenuScript.js" file to "MenuScript.asp" and
Include the line I wanted to use in javascript file?

and then:
I will use the below line in my home page ("default.htm")?
<script type='text/javascript' src='Scripts/MenuScript.asp'></script>

But if so will the "script type='text/javascript' " still work ?


That is what I am trying to tell you,
but better than believing me, try it out.]

Using a session variable:
var blahClientside = '<% =session("blahServersideVBSorJS") %>';

Or the server time:
var timeOnServer = '<% =now %>';
btw:
About the same goes for:
<img src='myJpg.asp'>
[as long as you send an image stream with the right disposition header]
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Oct 31 '05 #6

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

Similar topics

0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.