The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Referencing a js page, Unable to link to a script page
arcticwanderer
post Jun 22 2007, 11:04 AM
Post #1


Newbie
*

Group: Members
Posts: 12
Joined: 22-June 07
Member No.: 3,151



Hello

This should be a simple thing but I can't get it right. If you look at the source on my website www.montagnaphotography.com I have a js code in the body that begins with the following:

<script>
/*****************************************************************************
Default browsercheck - Leave this one
******************************************************************************/
function lib_bwcheck(){ //Browsercheck (needed)
this.ver=navigator.appVersion; this.agent=navigator.userAgent .........</script>

The script works fine but is long and I want to cut it out of the body and put on a seperate page. I've cut it out, put it as a js.script file and tried referencing it using several codes such as: <script src="http://www.montagnaphotography.com/scripts.js" type=text/javascript></SCRIPT> without any luck. Does anyone have a suggestion how to reference the script correctly?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
Frederiek
post Jun 23 2007, 03:56 AM
Post #2


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



An url was already provided: http://www.montagnaphotography.com

There is no javascript error, but the HTML does have errors when passing the page through the WDG validator. Some are related to the script element. Start by fixing those first.

For instance, you have:
<script language=JavaScript1.2 src="coolmenus3.js">">

The correct syntax is:
<script type="text/javascript" src="coolmenus3.js"></script>

(be sure to quote attribute properties, that goes for all attribute values in HTML tags too)

Other script elements in the page don't have a TYPE.

See the HTMLreference for the script element

You can link to the different scripts by adding as many such script elements to the page, eg. one for each functionality by copying the script in a text file, like you did for coolmenus3.js. Leave the legal comments together with the corresponding scripts. Then, if someone takes the code, the legal notice will be included with a reference to the original site of that script.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 23 2007, 04:46 AM
Post #3


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



QUOTE(Frederiek @ Jun 23 2007, 10:56 AM) *

An url was already provided: http://www.montagnaphotography.com

Christian tricked me. blush.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 25th April 2024 - 08:27 AM