|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
javascript to a seperate folder?
Hiya all, Sorry about this, I feel a bit thick asking this but I really need to know.
I know that javascript in the head of the document should be kept in a seperate file so that the robots don't have to trawl through it, but what is the best way to do this? Is it simply a case of highlighting it all then cut and paste it into a folder marked .js? Im sure it cant be that simple but then Im also sure it can't be that hard. Anyone shed any light on the subject? Please. |
|
#2
|
|||
|
|||
|
you have the javascript as follows:
<SCRIPT LANGUAGE="JavaScript"> <!-- xyz // --> </SCRIPT> then to call it up, you would need to copy: <!-- xyz // --> into a text file and save it as java.js (or whatever) then open up the java.js file and delete the commment tags (<!-- // -->) as these will just **** things up. now go back to your original page and you should have: <SCRIPT LANGUAGE="JavaScript"> </SCRIPT> change it to the following to call up the javascript: <SCRIPT LANGUAGE="JavaScript" src="java.js"></SCRIPT> (ie. just add src="" to it, just like an image calls up it's source <img src="x.jpg">) hope that helps |
|
#3
|
||||
|
||||
|
Cheers fraggle. Thats great, I new it wouldn't be too difficult but I wasn't sure how to make things call up the javascript.
Thanks again. |
|
#4
|
|||
|
|||
|
oops ... i copied that from an email i sent to a friend a couple of days ago and looks like i left a dodgy word in there
No porblem anyway |
|
#5
|
||||
|
||||
|
Thats fine, Might as well say it as think it I say.
Tried it out and all works perfectly. Cheers for the tip. |
![]() |
| Viewing: SEO Chat Forums > Other > HTML Coding > javascript to a seperate folder? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|