What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » External javascript

External javascript
Author: Message:
k776
Junior Member
**

Avatar

Posts: 98
Reputation: 3
– / Male / –
Joined: Aug 2004
O.P. External javascript
Ok, got one code to work, but how do you add different codes that are called by two different pages?? It gives me errors :(

Thanks for the help anyone.
[Image: k776.jpg]
08-25-2004 09:22 AM
Profile PM Web Find Quote Report
Mnjul
forum super mod
******

Avatar
plz wub me

Posts: 5396
Reputation: 58
– / Other / Flag
Joined: Nov 2002
Status: Away
RE: External javascript
Well, k776, would you explain more? :)
08-25-2004 10:01 AM
Profile PM Web Find Quote Report
k776
Junior Member
**

Avatar

Posts: 98
Reputation: 3
– / Male / –
Joined: Aug 2004
O.P. RE: External javascript
ok, you have javascript on page.html, you move it to jscript.js, but you also have javascript on page2.html, and want to add it to jscript.js.

I tried to do so but it gave me tons of errors (also, how do you put comment in javascript files??)
[Image: k776.jpg]
08-25-2004 10:44 AM
Profile PM Web Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
35 / Male / Flag
Joined: Mar 2004
RE: External javascript
/* comment */
[Image: dt2.0v2.png]      Happy Birthday, WDZ
08-25-2004 10:50 AM
Profile PM Web Find Quote Report
Mnjul
forum super mod
******

Avatar
plz wub me

Posts: 5396
Reputation: 58
– / Other / Flag
Joined: Nov 2002
Status: Away
RE: External javascript
Or //comment

k776,
Add this to your html file?
<script src="blahblahblah.js"></script>

For example, you have...

\1.html
\blah\2.html
\blah\3.js

In 1.html you need to use <script src="blah\3.js"></script>
And in 2.html you use <script src="2.js"></script>

This post was edited on 08-25-2004 at 11:11 AM by Mnjul.
08-25-2004 10:53 AM
Profile PM Web Find Quote Report
k776
Junior Member
**

Avatar

Posts: 98
Reputation: 3
– / Male / –
Joined: Aug 2004
O.P. RE: External javascript
ok, I figured out what was wrong. It had nothing to do with the pages, rather the .js file. As this was my first time with these files, I read keep all code inside <!-- and --> tags

Well, the thing is, I did this:
code:
<!--
javascript code
-->
<!--
another code
-->
When it should have only been
code:
<!--
javascript code

another code
-->
Thanks for the help anyway :)
[Image: k776.jpg]
08-25-2004 08:56 PM
Profile PM Web Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: External javascript
Or just
code:
javascript code

another code
HTML comments aren't needed in external JS files.
[Image: spartaafk.png]
08-25-2004 09:52 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On