Javascript source
Hi every-1,
I'm (still) working on an Intranet for a company and I want to put all the JS in an external file called 'Javascripts.js'.
In the HTML pages I try to call the JS-functions like this:
Code Sample:
<script language="javascript src="javascripts.js">
</script>
Unfortunately when I run it I get the following error:
Code Sample:
There has been an error in the script on this page.
Line: 1
Character: 1
Error: Syntaxis Error
Code : 0
Is 'Line 1' the line 1 from the HTML-page or from the external javascript-file??
I looked at both of them but can't find any errors.
The HTML-page (which is actually an ASP-page, maybe that is the problem) begins with this:
Code Sample: <% @ language="VBScript"%>
The external file begins with this:
Code Sample:
function etc...
I'm doing something wrong, but I don't get it. W H O D O E S ? ?
Thanx in advanx,
------------------
Jack Michaelson
[email protected]
! Click here for my profile !
[This message has been edited by Jack Michaelson (edited 17 December 1999).]
Shakespeare: onclick || !(onclick)
Anonymous posted this at 16:34 — 17th December 1999.
They have: 5,633 posts
Joined: Jan 1970
The only thing I can see is that there is no finishing quote marks around the word javascript, it should read:
And remember to make sure that the .js file is in the same directory as the HTML page.
I don't know much about ASP, so I wouldn't know if there is anything wrong with that part of the code.
I think that when you get an error it is refering to the HTML page.
Vincent Puglia posted this at 14:52 — 19th December 1999.
They have: 634 posts
Joined: Dec 1999
Hi,
Most js include sytnax errors refer to the js file. However, line 1 can be line umpteen in the js file.
To know for sure, create a dummy js file of 1 line ( var x = "This file";
put an elert in your html that runs as it loads. See if it executes.
Vinny
------------------
Where the world once stood
the blades of grass cut me still
Jack Michaelson posted this at 07:45 — 20th December 1999.
He has: 1,733 posts
Joined: Dec 1999
Tomworld and Vinny, thanx for replying,
The problem was not caused by the missing quote mark. In the original script the mark was there.
I also tried the dummy-file and the alert loaded so that wasn't the problem either.
I kept on trying to get things to work and when I deleted some JS-functions generated by Dreamweaver everything went fine.
I don't know why because when I put those functions in the HTML-file they do what they are supposed to do. But it works and that's why I'm leaving it this way.
------------------
Jack Michaelson
[email protected]
! Click here for my profile !
Shakespeare: onclick || !(onclick)
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.