f0x
Punk
Hi,
Warum werden auf Seiten, welche auf meinem apache laufen, nur einige Java-Scripts ausgeführt und andere nicht?
Scripts wie z.B. Grafik-Veränderungen mit onmouseover usw funktionieren einwandfrei. Jedoch werden bei diesem Script hier nur eine leere (schwarze) Seite und eine leere Scroll-Tabelle angezeigt
Hier noch die getpics.php, falls es daran liegt....
Ich benutze den 1.3 apache auf OpenBSD 4.3
Auf meinem Windows Rechner mit xampp läuft das script einwandfrei...
Kann mir irgendjemand sagen was ich tun muss?
Danke im Vorraus,
f0x
Warum werden auf Seiten, welche auf meinem apache laufen, nur einige Java-Scripts ausgeführt und andere nicht?
Scripts wie z.B. Grafik-Veränderungen mit onmouseover usw funktionieren einwandfrei. Jedoch werden bei diesem Script hier nur eine leere (schwarze) Seite und eine leere Scroll-Tabelle angezeigt
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<head>
<style type="text/css">
#picturearea{
filter:alpha(opacity=100);
-moz-opacity: 0;
}
</style>
</head>
<body bgcolor="#000000" text="#C0C0C0" link="#C0C0C0" vlink="#C0C0C0">
<script src="getpics.php" type="text/javascript"></script>
<script type="text/javascript">
function populateSelect(selectobj){
for (var i=0; i<picsarray.length; i++)
selectobj.options[selectobj.options.length]=new Option(picsarray[i], picsarray[i])
if (selectobj.options.length>1){
selectobj.selectedIndex=0
showpicture(document.getElementById("picsform").picslist)
}
}
function showpicture(selectobj){
piccontainerobj=document.getElementById("picturearea")
resetfade(10)
piccontainerobj.innerHTML='<a href="'+locationstring+selectobj.options[selectobj.selectedIndex].value+'"><img src="'+locationstring+selectobj.options[selectobj.selectedIndex].value+'" width="640" height="480"></a>'
fadepictoview=setInterval("gradualfade(piccontainerobj)",50)
}
function resetfade(degree){
if (window.fadepictoview)
clearInterval(fadepictoview)
if (typeof piccontainerobj.style.MozOpacity=="string")
piccontainerobj.style.MozOpacity=degree/100
else if (piccontainerobj.filters)
piccontainerobj.filters.alpha.opacity=degree
}
function gradualfade(){
if (typeof piccontainerobj.style.MozOpacity=="string" && piccontainerobj.style.MozOpacity<1)
piccontainerobj.style.MozOpacity=Math.min(parseFloat(piccontainerobj.style.MozOpacity)+0.2, 0.99)
else if (piccontainerobj.filters && piccontainerobj.filters.alpha.opacity<100)
piccontainerobj.filters.alpha.opacity+=20
else //if not IE or Moz
clearInterval(fadepictoview)
}
window.onload=function(){
populateSelect(document.getElementById("picsform").picslist)
}
</script>
<div style="float: left; width: 200px;">
<form id="picsform">
<select name="picslist" size="30" style="width: 200px" onClick="showpicture(this)">
</select>
</form>
</div>
<div id="picturearea" style="float: left; width: 400px; height: 300px; margin-left: 20px">
</div>
<br style="clear: left" />
</body>
</html>
Code:
<?
Header("content-type: application/x-javascript");
$pathstring=pathinfo($_SERVER['PHP_SELF']);
$locationstring="http://" . $_SERVER['HTTP_HOST'].$pathstring['dirname'] . "/";
function returnimages($dirname=".") {
$pattern="(\.jpg$)|(\.png$)|(\.jpeg$)|(\.gif$)";
$files = array();
$curimage=0;
if($handle = opendir($dirname)) {
while(false !== ($file = readdir($handle))){
if(eregi($pattern, $file)){
echo 'picsarray[' . $curimage .']="' . $file . '";';
$curimage++;
}
}
closedir($handle);
}
return($files);
}
echo 'var locationstring="' . $locationstring . '";';
echo 'var picsarray=new Array();';
returnimages()
?>
Ich benutze den 1.3 apache auf OpenBSD 4.3
Auf meinem Windows Rechner mit xampp läuft das script einwandfrei...
Kann mir irgendjemand sagen was ich tun muss?
Danke im Vorraus,
f0x

