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

importing a .js file to a html page

Hi all,

Instead of writing javascript functions on the html page it self, we could write those in separate “.js” file and import it as follow.

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


But when we do this and check the web page source on the browser, there is no any JavaScript function there..
But those functions are running without any problem..

So I want to know where those JavaScript functions are..????
Those should be in the client side not in server side..


Thanks....
janaka priyadarshana
Feb 19 '07 #1
6 1778
dorinbogdan
839 Expert 512MB
If the script is in a .js file, the script can be read by loading it directly and it can be downloaded by writing an HREF for it.
Feb 19 '07 #2
acoder
16,027 Expert Mod 8TB
Hi all,

Instead of writing javascript functions on the html page it self, we could write those in separate “.js” file and import it as follow.

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


But when we do this and check the web page source on the browser, there is no any JavaScript function there..
But those functions are running without any problem..

So I want to know where those JavaScript functions are..????
Those should be in the client side not in server side..


Thanks....
janaka priyadarshana
Those Javascript functions are in the file. The file is separate from your html file. It's actually more convenient this way as it prevents cluttering up your markup code.
Feb 19 '07 #3
here i want to know the place where it exist on the client machine..?

if we write those functions on the html page itself those can be read by checking the source of the page.

but when we use .js file those functions can not be viewed. so how those are executed by the client browser....?
Feb 20 '07 #4
dorinbogdan
839 Expert 512MB
here i want to know the place where it exist on the client machine..?

if we write those functions on the html page itself those can be read by checking the source of the page.

but when we use .js file those functions can not be viewed. so how those are executed by the client browser....?
I know that the .js files should be downloaded somewhere in Temporary Internet Files\
Feb 20 '07 #5
dorinbogdan
839 Expert 512MB
I just tested it and it's true....
I open www.personal.ro and the file "cookie.js" referenced in page, appears in Internet Temporary Files folder.
Feb 20 '07 #6
acoder
16,027 Expert Mod 8TB
here i want to know the place where it exist on the client machine..?

if we write those functions on the html page itself those can be read by checking the source of the page.

but when we use .js file those functions can not be viewed. so how those are executed by the client browser....?
They can easily be accessed by the browser just like an image. An image is not contained within the page, it is a separate file, but the browser follows the link and displays the image. See this page on ways to include javascript on your page.
Feb 20 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Oleg | last post by:
Hi, Not really a PHP specific question, but I am using PHP on Linux box so it's kinda relevant. I'm developing a site which will periodically update inventory via a large batch file. I'm...
4
by: jean-marc | last post by:
As an application programmer, I'm not well versed in the material aspects of computing (memory, cpu, bus and all). My understanding of imports in Python is such: the __main__ program is the center...
6
by: Kamilche | last post by:
I have a large project that is getting complex, and I would like to print the docstrings without importing the modules. The only Python utility I could find references is apparently defunct and...
11
by: Grim Reaper | last post by:
I am importing a .csv file into Access that has 37 fields. My problem is that sometimes the last field only has data at the end of the column (it looks like when you import a file into Access, for...
29
by: Natan | last post by:
When you create and aspx page, this is generated by default: using System; using System.Collections; using System.Collections.Specialized; using System.Configuration; using System.Text; using...
7
by: McGeeky | last post by:
Hi. I have a page that is based on a master page. But how do I tell this page to use a CSS file using the LINK tag in the HEAD tag when the master page has this declaration in it? -- McGeeky...
17
by: OdAwG | last post by:
Just some questions regarding tables. I am new Access Database and need a little help. I have the following data listed below 01. I have a table called tbl_Customer with the following...
1
by: Phil | last post by:
I want to add a button to a form to import a text delimited file. The File is delimited by "^" and so I have created a specification file by manually impoting the text file, using the advanced...
5
by: phpmagesh | last post by:
Hi All, I have html page, in that i have some flash header. In that flash header i have sound on/off function. i implemented this in my html page. but i need some modification in this. now it...
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: 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: 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.