Referencing a js page, Unable to link to a script page |
Referencing a js page, Unable to link to a script page |
arcticwanderer |
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? |
Frederiek |
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. |
Lo-Fi Version | Time is now: 26th April 2024 - 08:53 AM |