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

customising external .js files

can you use asp to customise external js files e.g.

<script src="fred.js"></script>

where fred gets the page id and changes an image in the .js file to suit?

mark
Jul 19 '05 #1
6 2581
What I would do, is have a function in fred.js that accepts a parameter

For example in fred.js

function Start(aString)
{
alert(aString);
}

then in your "asp" code...

<%
Dim sString
sString="'Hello'"
%>

<script src="fred.js"></script>
<script language=Javascript>
Start(<%=sString%>)
</script>

which would result in
<script src="fred.js"></script>
<script language=Javascript>
Start('Hello')
</script>
"mark | r" <ma**@nmd.freeuk.com> wrote in message
news:3f*********************@news.dial.pipex.com.. .
can you use asp to customise external js files e.g.

<script src="fred.js"></script>

where fred gets the page id and changes an image in the .js file to suit?

mark

Jul 19 '05 #2
wjat i mean is can the contents of a .js file be built?

mark
Jul 19 '05 #3
<script src="fred.ASP">

Use that, and then in fred.asp, response.write your client-side code as
needed.

Ray at work

"mark | r" <ma**@nmd.freeuk.com> wrote in message
news:3f*********************@news.dial.pipex.com.. .
wjat i mean is can the contents of a .js file be built?

mark

Jul 19 '05 #4
I suppose you could ask ... why? If it's dynamic then what's the point of it
being a src="" since there is no point in caching it.

Generalise your scripts enough to be cacheable and then put the dynamic
stuff direct into the html page?

Do you have a specific aim in mind for this since it's not clear what the
context or final intention is?

Chris.
"mark | r" <ma**@nmd.freeuk.com> wrote in message
news:3f*********************@news.dial.pipex.com.. .
wjat i mean is can the contents of a .js file be built?

mark

Jul 19 '05 #5
"Chris Barber" wrote:

I suppose you could ask ... why? If it's dynamic then what's
the point of it being a src="" since there is no point in
caching it.


One reason comes to mind. I believe it has been explored in
ms.public.scripting.jscript as a means for hiding source code from prying
eyes. I don't recall the consensus on its effectiveness, however.
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 19 '05 #6
its an include to hide a non accessible element from a text browser.

mark

"Dave Anderson" <GT**********@spammotel.com> wrote in message
news:Ov**************@TK2MSFTNGP10.phx.gbl...
"Chris Barber" wrote:

I suppose you could ask ... why? If it's dynamic then what's
the point of it being a src="" since there is no point in
caching it.
One reason comes to mind. I believe it has been explored in
ms.public.scripting.jscript as a means for hiding source code from prying
eyes. I don't recall the consensus on its effectiveness, however.
--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message.

Use of this email address implies consent to these terms. Please do not contact me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.

Jul 19 '05 #7

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

Similar topics

4
by: Erohsik | last post by:
I am using external tables to load data from the data file. But the log files are getting created in the datafile's directory (because of CREATE OR REPLACE DIRECTORY ...) But I want those log...
1
by: Aravind | last post by:
we have two files: 1. rc4.c (defines one function "create_pin()") 2. MyImpl.c(calling the function "create_pin()"),This implements JNI method. 1.When I am trying to create .dll file with one...
10
by: Pasquale | last post by:
hello wverybody... i've got a terrible matter with JS my browsers (either IE and NN) load the external scripts uncorrectly...they load the files from the half part of them and not from the...
19
by: J. J. Farrell | last post by:
After many years of dealing with definition and linkage issues in ways that I know to be safe, I've decided it's time to try to understand this area properly. Consider a header file with the file...
1
by: Laszlo | last post by:
Hi all, As a novice I installed PostgreSQL 7.2.1 on Win32 and works, Borland C++Builder Enterprise Suite 5.0 (build 12.34) what works too. I decided to combine these two programs and develop a...
3
by: eieiohh | last post by:
MySQL 3.23.49 PHP 4.3.8 Apache 2.0.51 Hi All! Newbie.. I had a CRM Open Source application installed and running. Windows Xp crashed. I was able to copy the contents of the entire hard...
2
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: ...
2
by: =?Utf-8?B?YmFzaA==?= | last post by:
Hello, I am compiling a CPP code using Visual studion .net 2003. I get the following error, despite having windldap.h and wldap32.dll in my include and lib paths. Here is the error. uuid.lib...
0
by: =?Utf-8?B?S2VsbHk=?= | last post by:
Each fall and winter I deal witht he same problem. When the daylight savings time comes into effect the time stamp for files on my external portable hard drive are 1 hour out from the time stamps...
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
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
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.