473,490 Members | 2,488 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Probably a daft question?

but I'm a bit puzzled with javascript functions you can include to use in a
JSP page - you can't see them in the page source code but can call them -
does this mean

they are called on the server each time - I always thought javascript was
client side only?

or are all of them in the include .js file downloaded for use at the client
end somewhere?

enlighten me someone?

thanks

harry
Jul 20 '05 #1
5 1614
Include files are part of the page that is called, if the files are created
for server side use ie asp files etc then they are run on the server and
there is no need for them to be downloaded by the client, however if you
have front end code, ie .js files and have not specified them to run on the
server they will be downloaded with the page. The files will be stored on
the client allowing multiple use and in effect quicker download times long
term.

hope this helps

Simn Christie

"Harry" <a@abc.com> wrote in message
news:Pc*********************@news-text.cableinet.net...
but I'm a bit puzzled with javascript functions you can include to use in a JSP page - you can't see them in the page source code but can call them -
does this mean

they are called on the server each time - I always thought javascript was
client side only?

or are all of them in the include .js file downloaded for use at the client end somewhere?

enlighten me someone?

thanks

harry

Jul 20 '05 #2
"Harry" <a@abc.com> wrote:
but I'm a bit puzzled with javascript functions you can include to use in a
JSP page - you can't see them in the page source code but can call them -
does this mean

they are called on the server each time - I always thought javascript was
client side only?

or are all of them in the include .js file downloaded for use at the client
end somewhere?


If you're talking about this kind of syntax:

<SCRIPT LANGUAGE="Javascript" SRC="something.js">

Then yes, that's handled by the client-side browser. When the browser
encounters this statement, it issues an HTML request for
"something.js", and interprets it just as if its contents were between

<SCRIPT LANGUAGE="Javascript">

and

</SCRIPT>

tags.

Various server-side processing schemes (ASP, PHP, etc) implement
server-side includes. If you use those, the included file is
transmitted to the client as part of the original request, the client
never knows that the content came from a separate file.

--
Tim Slattery
Sl********@bls.gov
Jul 20 '05 #3
Thanks chaps, makes sense now - just a bit puzzled why when viewing page
source you can't actually see the javascript functions!

"Harry" <a@abc.com> wrote in message
news:Pc*********************@news-text.cableinet.net...
but I'm a bit puzzled with javascript functions you can include to use in a JSP page - you can't see them in the page source code but can call them -
does this mean

they are called on the server each time - I always thought javascript was
client side only?

or are all of them in the include .js file downloaded for use at the client end somewhere?

enlighten me someone?

thanks

harry

Jul 20 '05 #4
The functions are not in the downloaded page but can be references by that
page.

in this way you could have a function

eg
function showAlert(str){
alert(str)
}

and if you wanted to use the function in 2 html pages, then you include the
..js file in both and only need to download it once as it would be cached on
the client machine.

hope this helps

Simon Christie

"Harry" <a@abc.com> wrote in message
news:7x*********************@news-text.cableinet.net...
Thanks chaps, makes sense now - just a bit puzzled why when viewing page
source you can't actually see the javascript functions!

"Harry" <a@abc.com> wrote in message
news:Pc*********************@news-text.cableinet.net...
but I'm a bit puzzled with javascript functions you can include to use in
a
JSP page - you can't see them in the page source code but can call

them - does this mean

they are called on the server each time - I always thought javascript was client side only?

or are all of them in the include .js file downloaded for use at the

client
end somewhere?

enlighten me someone?

thanks

harry


Jul 20 '05 #5
Harry wrote:
Thanks chaps, makes sense now - just a bit puzzled why when viewing page
source you can't actually see the javascript functions!

You can if you just put the name of their JavaScript file in your
browser's address bar. If you see a line like this:

<script type="text/javascript" src="jscode/page.js"></script>

And your browser is looking at:

http://www.example.com/mypage.html

Then, just type this:

http://www.example.com/jscode/page.js

And you will probably be prompted to save the file to your computer (or
it will just display the code). You're just duplicating what the
browser does and saving the results for your viewing enjoyment.

HTH,
Zac
"Harry" <a@abc.com> wrote in message
news:Pc*********************@news-text.cableinet.net...
but I'm a bit puzzled with javascript functions you can include to use in


a
JSP page - you can't see them in the page source code but can call them -
does this mean

they are called on the server each time - I always thought javascript was
client side only?

or are all of them in the include .js file downloaded for use at the


client
end somewhere?

enlighten me someone?

thanks

harry



Jul 20 '05 #6

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

Similar topics

6
1351
by: malcolm | last post by:
How does one get the primary key of the row that is joined in via a group by aggregate clause when the aggregate is not performed on the primary key? For example, Person table ( PersonID...
15
12699
by: Jim | last post by:
This is probably a common question - What is the best CSS editor? I'm an old HTML dinosaur that just getting into CSS. My HTML editor from way back is Homesite. They (Macromedia) tout Topstyle Pro...
3
1594
by: Nicke | last post by:
Hi, I've used vb.net for 3 hours(!) now and have probably a very easy question. In my VB6 programs I use For Each Cell in Range... very often which not seems to work in vb.net. Ex. Dim Cell...
2
1128
by: Scott Manson | last post by:
I am working on a database access program using C# and am having a few problems. I am collecting data that may or may not be in order and may or may not be in the database. I have 2 classes that...
1
1752
by: jm | last post by:
Easy probably, please read on. I know some of you have commented already about some of my socket question. I appreciate that. I have a Form1: static void Main() { Application.Run(new...
7
1254
by: Matt | last post by:
I've asked this question to some developers that are much more experienced than I, and gotten different answers --- and I can't find anything about it in the documentation. Dim vs. Private as a...
1
5841
by: Stef Mientki | last post by:
Does anyone know the equivalent of the MatLab "diff" function. The "diff" functions calculates the difference between 2 succeeding elements of an array. I need to detect (fast) the falling edge of...
3
1883
by: Rangy | last post by:
Hi, I've decided to take the plunge and move from tables to a pure css layout. I still "think" in tables when I do my layouts and I was wondering the following: I have a simple, standard two...
0
7108
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6967
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
7181
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...
1
4875
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...
0
3078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1383
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
618
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
272
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.