Jump to content

Creating seperate java script files


HTMLweasel

Recommended Posts

Hi thereThrough looking at different source code I have notice some javascript statements as the one below.<script language=javascript src="ITzonen - Nyheder, tests og meget mere!_files/resizableViewer.js" type=text/javascript></SCRIPT>Does this mean that there is a sort of class (file that has all the methods) in the directory or location specified by src??Thanks:)

Link to comment
Share on other sites

You can put your javascript in a file instead of putting it inline.the js file has the javascript that otherwise you would use inline.Code 1:

<script language=javascript>alert("rachit");</script>

Now make a file calles scr.js in which you would put this entry

alert("rachit");
Code 2:
<script language=javascript src=./scr.js></script>

Code 2 will give same effect as Code 1

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...