dele koden i flere filer?
Hei og hopp. Jeg har en javascript som ser slik ut:<?
include(\"inc-db.php\");
include(\"inc-venstre.php\");
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
</head>
<body bgcolor=\"#FFFFFF\" background=\"grafikk/bakgrunn_venstre.gif\" TOPMARGIN=0 LEFTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<script language=\"JavaScript1.2\" src=\"coolmenus3.js\">
</script>
<script>
function lib_bwcheck(){
this.ver=navigator.appVersion; this.agent=navigator.userAgent
this.dom=document.getElementById?1:0
this.ie5=(this.ver.indexOf(\"MSIE 5\")>-1 && this.dom)?1:0;
this.ie6=(this.ver.indexOf(\"MSIE 6\")>-1 && this.dom)?1:0;
this.ie4=(document.all && !this.dom)?1:0;
this.ie=this.ie4||this.ie5||this.ie6
this.mac=this.agent.indexOf(\"Mac\")>-1
this.opera5=this.agent.indexOf(\"Opera 5\")>-1
this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5 || this.dom)
return this
}
var bw=new lib_bwcheck()
var mDebugging=2
oCMenu=new makeCoolMenu(\"oCMenu\")
oCMenu.useframes=1
oCMenu.frame=\"frmMain\"
oCMenu.useclick=0
....
bla bla bla... (mange koordinater)
-------------------------------------------------------------------------------------------
oCMenu.makeMenu(\'top0\',\'\',\' News\',\'/news/index.asp\',\'\')
oCMenu.makeMenu(\'sub00\',\'top0\',\'Newest news\',\'/news/index.asp\')
oCMenu.makeMenu(\'sub001\',\'sub00\',\'- New DHTML API released\',\'\',\'\',160,0)
oCMenu.makeMenu(\'sub002\',\'sub00\',\'- Explorer 7 is out\',\'\',\'\',160,0)
oCMenu.makeMenu(\'sub003\',\'sub00\',\'- Opera 6 supports innerHTML\',\'\',\'\',160,0)
oCMenu.makeMenu(\'sub01\',\'top0\',\'News archive\',\'/news/archive.asp\')
----------------------------------------------------------------------------------------------
oCMenu.makeStyle(); oCMenu.construct()
</script>
SPØRSMÅL:
hvordan kan jeg legge den delen som er merket med --- inn i en egen fil og så kjøre den derfra?
camilla.
