Web Design Forum  
 
Go Back   Web Design Forum > Web and Graphic Design > Web Design

Reply
 
LinkBack Thread Tools Display Modes
Old 01-14-2012, 01:14 PM   #1
Bronze Member
 
Join Date: Feb 2010
Location: Satellite-Town, Lagos, Nigeria, West-Africa.
Posts: 89
Default Connecting a .js file to an html file.

Hello Friends,
I am having a little stress in connecting my .js external file to my html.
In CSS, there's a tool in the Properties Panel of dream weaverused in linking .css to html. Now, my questions is: Is there a tool that can be used to link each page automatically, once, just like in css.
Thanks,
Golden Waters.

Last edited by goldenwaters; 01-14-2012 at 01:18 PM.
goldenwaters is offline   Reply With Quote


Old 01-17-2012, 10:04 AM   #2
New Member
 
artimes's Avatar
 
Join Date: Jan 2012
Location: west sussex
Posts: 11
Default

I'm not sure if there's a option for inserting external javascript files into your html document. But in the code you just add:

<script language="JavaScript" src="your-javascript-file.js" type="text/JavaScript"></script>

Make sure you copy that before your </head> and change your-javascript-file.js to whatever yours is called.

Hope that helps.
artimes is offline   Reply With Quote
Old 01-17-2012, 11:50 AM   #3
Diamond Member
 
Phreaddee's Avatar
 
Join Date: Feb 2011
Location: Newcastle, Australia
Posts: 1,137
Default

Alternatively add it just before the closing body tag to speed up load time.
__________________
if (headhurts == "possibly") {
alert ("keep going!");
}
else if (headhurts == "yes") {
alert ("go to sleep");
}
else if (headhurts == "damn !@#$ mofo scripts...") {
alert ("give up and have a beer!");
}
else {
alert ("watch TV");
}
Phreaddee is offline   Reply With Quote
Old 01-18-2012, 02:01 PM   #4
Bronze Member
 
Join Date: Feb 2010
Location: Satellite-Town, Lagos, Nigeria, West-Africa.
Posts: 89
Default

Thanks Phreaddee and Artimes, your response is helpful. I have been able to do it just as you both advised me to.

Thanks,
Golden Waters
goldenwaters is offline   Reply With Quote
Reply

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

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



All times are GMT. The time now is 11:38 AM.


Camera Forum - Computer Forum - Web Design Forum

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.