WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Site Design > Graphics & Design Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Graphics & Design Discussion Forum Post your graphics design questions/comments/ideas in here. Ask questions, post tutorials, discuss trends and best practices. Sub-forum for website accessibility and usability.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-08-2004, 08:25 PM
WebProWorld Member
 

Join Date: Mar 2004
Location: online
Posts: 34
charms987 RepRank 0
Default Question about .js files

Hi all,

My questions revolve around the JavaScript file. I have a number of scripts on each of my pages. I have been told to add them to a .js file and refer to that file on the webpage.

I have accomplished this with a CSS file for styles.

How do I do this with JavaScript? Then once I have the file, what code do I use to in the web page?

Does anyone have a good tutorial?

For example, I have one script one every page that has graphics that will allow you to "click to enlarge!” I have other scripts on the same page.

1. How do I consolidate all the scripts in one file?

2. What code do I put at the top of the web page (some like this? = <link rel=stylesheet type="text/css" href="FILENAME.css">)?

3. What do I put on the webpage to reference which JavaScript from the .js file that I want to use?

Confused yet? I sure as hell am! :) :)

Thanks in advance for all your help.

M
__________________
http://www.nipplecharms.com/ - We welcome your comments on our site! Please e-mail us.
Reply With Quote
  #2 (permalink)  
Old 06-08-2004, 08:40 PM
WebProWorld Pro
 

Join Date: Jul 2003
Location: New Jersey, U.S.
Posts: 293
jdiben RepRank 0
Default

Copy all of the code between the <script> tags into a text file. Name the file filename.js and put it in the same folder as your html pages. In the pages that you want to use the javascript on put the following in the <head> of your page.
Code:
<script src="filename.js"></script>
Try this link for a quick tutorial.

Joe
Reply With Quote
  #3 (permalink)  
Old 06-09-2004, 05:56 AM
WebProWorld Member
 

Join Date: Mar 2004
Location: online
Posts: 34
charms987 RepRank 0
Default

Quote:
Originally Posted by jdiben
Copy all of the code between the <script> tags into a text file. Name the file filename.js and put it in the same folder as your html pages. In the pages that you want to use the javascript on put the following in the <head> of your page.
Code:
<script src="filename.js"></script>
Try this link for a quick tutorial.

Joe
Dear Joe,

thanks. I will give the tutorial a spin!!!

M
__________________
http://www.nipplecharms.com/ - We welcome your comments on our site! Please e-mail us.
Reply With Quote
Reply

  WebProWorld > Site Design > Graphics & Design Discussion Forum
Tags: ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0