Unterschied js internexern ?

hallo,

ich habe einen javascript in einer html-datei.

sobald ich diesen jedoch in eine externe js-datei packe, funtkioniert nix mehr…

was muss ich beachten-- eigentlich sollte das doch auch vonner js-datei ohne probleme funktionieren…

function lib\_bwcheck(){ //Browsercheck (needed)
 this.ver=navigator.appVersion
 this.agent=navigator.userAgent
 this.dom=document.getElementById?1:0
 this.opera5=this.agent.indexOf("Opera 5")\>-1
 this.ie5=(this.ver.indexOf("MSIE 5")\>-1 && this.dom && !this.opera5)?1:0; 
 this.ie6=(this.ver.indexOf("MSIE 6")\>-1 && this.dom && !this.opera5)?1:0;
 this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
 this.ie=this.ie4||this.ie5||this.ie6
 this.mac=this.agent.indexOf("Mac")\>-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)
 return this
}
var bw=new lib\_bwcheck()


var oWin=new Array; oWin.zIndex=10; oWin.dragobj=-1; oWin.resizeobj=-1; oWin.zIndex=100
//Start Variables to set \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

//This script works in IE4+, NS4+ and Opera5. 
//Just remember that NS4 and Opera5 does not reflow the content when you resize the windows.


oWin.bordercolor="#313163" //Remember that you have to change the images as well if you change this color
oWin.bgcolor="#424286" //Default background color
oWin.bgcoloron="#313163" //The "active" background color
oWin.bgscroll="#424286" //The background-color for the scroll area"

//The rest of the style variables have to be set in the stylesheet above. 
//To change styles on the text change .clText

//If you change these variables I assume you would like to change the images, image sizes and the imagemap for 
//the windows. If so you'll have to do that manually in the addWindow function for now.

oWin.bottomh=10 //The height of the bottom "border"
oWin.headh=15 //The height of the head "border"
oWin.bordersize=1 //The left and right bordersize
oWin.scrollw=13 //The width of the scroll area
oWin.scrollimgh=12 //The width of the scroll images
oWin.buttonsw=39 //The width of the buttons image
oWin.resizeh=9 //The width of the resize img
oWin.resizew=13 //The height of the resize img

oWin.starty=5 //If you have a header or something on the page that you want the setWindows and the dragdrop to care about set it here.
oWin.defwidth=200 //Default width for the windows if nothing is spesified
oWin.defheight=200 //Default height for the windows if nothing is spesified
oWin.between=15 //This variable controls how much space there will be between the windows when you use setWindows

//Set this variable to 1 if you want to be able to control the area the windows can be scrolled.
oWin.keepinside=0 //VALUE: 1 || 0
 oWin.maxX=500 //This is the maximum X value the windows can go to. Set this to "winpage.x2" to keep them inside the window. VALUE: "winpage.x2" || px
 oWin.maxY=500 //This is the maximum Y value the windows can go to. Set this to "winpage.y2" to keep them inside the window. VALUE: "winpage.y2" || px
 oWin.minX=50 //This is the minimun X value the windows can go to. Set to 0 to keep them inside the window. VALUE: px
 oWin.minY=50 //This is the minimum Y value the windows can go to. Set to 0 to keep them inside the window. VALUE: px


//In the next version of this script all variables can be set on each individual window as well

//End Variables to set \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

function lib\_bwcheck(){ //Browsercheck (needed)
 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)
 return this
}
var bw=new lib\_bwcheck(); 
//Uncomment the next line if you want the user to be sent to another page if he's using an old browser
//if(!bw.bw) location.href='sorry.html'

function lib\_doc\_size(){ //Page positions - needed!
 this.x=0;this.x2=bw.ie && document.body.offsetWidth-20||innerWidth||0;
 if(bw.ns6) this.x2-=2
 this.y=0;this.y2=bw.ie && document.body.offsetHeight-5||innerHeight||0;
 if(bw.ns6) this.y2-=4
 if(!this.x2||!this.y2) return message('Document has no width or height') 
 this.x50=this.x2/2; this.y50=this.y2/2;
 this.x10=(this.x2\*10)/100;this.y10=(this.y2\*10)/100
 this.ytop=140\*100/this.y2
 this.avail=(this.y2\*(100-this.ytop))/100
 this.origy=this.y2
 return this;
}
function lib\_moveIt(x,y){this.x=x;this.y=y; this.css.left=x;this.css.top=y}
function lib\_moveBy(x,y){this.moveIt(this.x+x,this.y+y)}
function lib\_showIt(){this.css.visibility="visible"}
function lib\_hideIt(){this.css.visibility="hidden"}
function lib\_bg(color){
 if(bw.opera5) this.css.background=color
 else if(bw.dom || bw.ie4) this.css.backgroundColor=color
 else if(bw.ns4) this.css.bgColor=color 
}
function lib\_clipTo(t,r,b,l,setwidth){ 
 if(tox){if(ox\>126) i=0; a=0; y-=oWin.headh; x=0}
 for(j=0;jh-oWin.bottomh-oWin.headh && this.state!="min"){
 this.oWindow.clipTo(0,w-oWin.scrollw-oWin.bordersize\*2,h-oWin.bottomh-oWin.headh,0,1); 
 this.oUp.moveIt(w-oWin.scrollw,oWin.headh)
 this.oUp.clipTo(0,oWin.scrollw-oWin.bordersize,h-oWin.bottomh-oWin.scrollimgh-oWin.headh,0,1); 
 this.oDown.moveIt(w-oWin.scrollw,h-oWin.bottomh-oWin.scrollimgh)
 this.oDown.clipTo(0,oWin.scrollw-oWin.bordersize,oWin.scrollimgh,0,1); this.oUp.showIt()
 this.oDown.showIt()
 }else{this.oUp.hideIt(); this.oDown.hideIt()}
}
var sctim=100;
var winScroll;
function win\_up(){
 clearTimeout(sctim);
 if(this.oText.y\>=this.oWindow.cb-this.oText.height-10 && winScroll){
 this.oText.moveBy(0,-8); 
 setTimeout(this.obj+".up()",30)
 }
}
function win\_down(){
 clearTimeout(sctim);
 if(this.oText.y-1 || id2\>-1){
 if(id2\>-1){ id=id2; oWin.resizeobj=id;
 }else{ 
 id=id1; oWin.dragobj=id
 oWin.clickedX=x-oWin[id].x; 
 oWin.clickedY=y-oWin[id].y
 }
 oWin[id].addZ()
 //Setting background-colors 
 for(i=0;i-1){ //Resize
 nx=x; ny=y
 oldw=oWin[id2].cr; oldh=oWin[id2].cb
 cw= nx -oWin[id2].x; ch= ny - oWin[id2].y
 if(cw-1){ //Move
 nx=x-oWin.clickedX; ny=y-oWin.clickedY
 if(nyeval(oWin.maxX)) nx=eval(oWin.maxX)-oWin[id1].cr
 else if(nxeval(oWin.maxY)) ny=eval(oWin.maxY)-oWin[id1].cb
 else if(ny-1) oWin[num].maximize(); else if(oWin.dragover\>-1) oWin[oWin.dragover].maximize()}
function setWindows(placeit,rez){
 between=oWin.between
 oWin.rows=Math.round((wins/3)+0.2)
 oWin.columns=1
 j=0;a=0;c=0;
 for(i=0;i\n'
 +' '+heading+' \n'
 +' \n'
 +'\n'
 +'\n'
 +'\n'
 +'\n'
 +'\n'
 +'\n'
 +' \n'
 +' \n'
 +' \n'
 +' \n'
 +' '
 if(content){
 str+=content+' \n'
 +' \n'
 +' \n'
 +' \n'
 +''
 }
 document.write(str)
 if(content) create\_window(num,x,y,w,h,bg,bga)
}
function endWin(){
 num=wins-1
 str='\n\n'
 +'\n'
 +' \n'
 +' \n'
 +''
 return str
}

für einen tip vielen dank im vorraus

gruß

rasta

ich habe einen javascript in einer html-datei.

sobald ich diesen jedoch in eine externe js-datei packe,
funtkioniert nix mehr…

was muss ich beachten-- eigentlich sollte das doch auch vonner
js-datei ohne probleme funktionieren…

Hi RASTA,

ja, eigentlich sollte das funktionieren.
Das ganze Script in eine Datei namens xxx.js kopieren und dann im der HTML-Seite folgenden Aufruf bringen:

LG, piranja

hi piranja,

erstmal herzlichen dank dafür, das du dich immer meiner probleme annimmst – ist nicht vergessen :smile:

ich hab einen schmarrn geredet-
der javascript würd schon funtkionieren-

wenn ich den css-style in eine externe datei auslagere und per „link“ definition einbinde, geht nix mehr - warum das nur? ist doch dasselbe im grün wie bei js???

gruß

rasta

[Bei dieser Antwort wurde das Vollzitat nachträglich automatisiert entfernt]

Hi!

erstmal herzlichen dank dafür, das du dich immer meiner
probleme annimmst – ist nicht vergessen :smile:

Nix zu danken! :wink:

wenn ich den css-style in eine externe datei auslagere und per
„link“ definition einbinde, geht nix mehr - warum das nur? ist
doch dasselbe im grün wie bei js???

Ja, auch das sollte funktionieren. Hm. Vielleicht kannst du mal den Link im head und einen Ausschnitt aus deiner css-Datei posten …
Hab so keine Idee, wo’s hängen könnte …

LG, piranja

unterschied zwischen angewandter dummheit und…
angeborener dummheit??

in seltenen fällen treten beide komplikationen gleichzeitig auf

hi piranja,

danke nochmal für deine hilfe. es funktioniert jetzt!
ein syntaktischer fehler…*ärger*(trotz x-mal drüberschaun)

gruß

rasta