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

Just learning.....

Jim
Forgive me if this is a stupid question. I am completely new to javascript.

If a javascript refernces a javascript file (*.js), when the page is
displayed in a browser, does the page get the *.js file added as inline
code, or does a call to the *.js file require another trip to the server to
get and execute the *.js code?

Thanks!
Jan 19 '06 #1
5 1142
Jim wrote:
If a javascript refernces a javascript file (*.js), when the page is
displayed in a browser, does the page get the *.js file added as inline
code, or does a call to the *.js file require another trip to the server
to get and execute the *.js code?


It makes another trip to the server of course. For it to be otherwise the
server would have to process the HTML document and look for <script>s.
(Also, since it still works if you access it on your file system instead of
a webserver ...)

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jan 19 '06 #2
Jim

"David Dorward" <do*****@yahoo.com> wrote in message
news:dq*******************@news.demon.co.uk...
Jim wrote:
If a javascript refernces a javascript file (*.js), when the page is
displayed in a browser, does the page get the *.js file added as inline
code, or does a call to the *.js file require another trip to the server
to get and execute the *.js code?
It makes another trip to the server of course. For it to be otherwise the
server would have to process the HTML document and look for <script>s.


I thought browser may do like they do for an image....find each and download
it into the cache to show onscreen.

Since the browser does this (the image thing) I thought they may do the same
with *.js files.
(Also, since it still works if you access it on your file system instead
of
a webserver ...)


Thanks for the info!
Jan 19 '06 #3
Jim said the following on 1/19/2006 3:46 AM:
"David Dorward" <do*****@yahoo.com> wrote in message
news:dq*******************@news.demon.co.uk...
Jim wrote:
If a javascript refernces a javascript file (*.js), when the page is
displayed in a browser, does the page get the *.js file added as inline
code, or does a call to the *.js file require another trip to the server
to get and execute the *.js code? It makes another trip to the server of course. For it to be otherwise the
server would have to process the HTML document and look for <script>s.


I thought browser may do like they do for an image....find each and download
it into the cache to show onscreen.


It does, in a way. And when you execute a function that is in that
external file it does not re-download it from the server.
Since the browser does this (the image thing) I thought they may do the same
with *.js files.


It does.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jan 19 '06 #4
Jim wrote:
It makes another trip to the server of course. For it to be otherwise the
server would have to process the HTML document and look for <script>s.


I thought browser may do like they do for an image....find each and
download it into the cache to show onscreen.


Yes, it does. That's what I said.
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jan 19 '06 #5
On 2006-01-19, Jim <re***@groups.please> wrote:
Forgive me if this is a stupid question. I am completely new to javascript.

If a javascript refernces a javascript file (*.js), when the page is
displayed in a browser, does the page get the *.js file added as inline
code, or does a call to the *.js file require another trip to the server to
get and execute the *.js code?
most servers and browsers implement something called "keepalive" this often
means the script although separate is asked for and arrives through the same
connection that delivered the page.
Thanks!


--

Bye.
Jasen
Jan 19 '06 #6

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

Similar topics

5
by: Ron Stephens | last post by:
The newly rechristened Python Learning Foundation is a web site dedicated to the assistance of people learning the Python programming language. Features include: 1. Daily lists of new and recent...
99
by: Jim Hubbard | last post by:
It seems that Microsoft not only does not need the classic Visual Basic developer army (the largest army of developers the world has ever seen), but now they don't need ANY Windows developer at a...
13
by: Lumpierbritches | last post by:
I'm curious as to why some questions posted here get results and solutions, while others are answered in a seemingly foreign language and I can't begin to comprehend or understand the answers that...
42
by: Andy | last post by:
and so far I'm loving it, I like the the authors don't beat around the bush and just come straight out and say what the book is sopposed to be. They assume the you have computer experience. I'm...
2
by: bokiteam | last post by:
Hi All, Here is my idea to save learning time - Personal learning book. What we really need is somebody really familiar our learning experience, and then takes the example to teach us. Save...
5
by: Hasin Hayder | last post by:
I have been working with PHP for more than 3yrs (I believe still I am beginner in this category) - I was present in several interview board. Which things disappointed me most is the "lack of...
6
by: MC felon | last post by:
Hi. I've just about learnt object oriented programming, operation of pointers, dereferencing of the same, functions and all other basic manipulations. Now, recently, i made the big leap to the...
21
by: shotokan99 | last post by:
guys, i read in some forums that php is just for hobbiest, and is not suited for some serius and heavy application. for robust and hi performance application asp.net or jsp is the way to go. how...
0
by: LK~ICT | last post by:
Sri Lanka rural e-learning project seeks corporate support Dec 04, 2007 (LBO) - A Sri Lankan e-learning initiative for rural students is seeking corporate sector support to expand and cover 400...
0
by: Elizabeth Barnwell | last post by:
Hi Everyone, This is a free, web-development learning tool that may be useful to you in learning CSS. http://www.yoyobrain.com/subjects/show/471 If you "Add the subject to your learning...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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,...

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.