Hej...
Jeg har nogle javascript koder jeg skal have rettet så de virker til Internet Explorer.
De virker perfekt i Firefox, men mit ønske er at få dem til at virke i IE
En der gider rette det?
_________________________
index.php>
<?php
session_start();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Webghost chatsystem</title>
<meta name="Generator" content="Stone's WebWriter 4">
<style type="text/css">
div#viewPort {
height:375px;
width:520px;
border:2px solid black;
position:static;
background: url(test.jpg);
}
div.dot {
width:51px;
height:70px;
position:absolute;
background:green;
display:none;
}
div#dot1 {
background: url(fig.gif);
}
</style>
<script type="text/javascript">
var viewPort = null;
var dot = null;
function Init() {
if (viewPort == null) viewPort = document.getElementById('viewPort');
viewPort.onclick = getXY;
refresh();
}
function getXY(e) {
var t = e.clientY;
var l = e.clientX;
setXY(l,t,dot,true);
}
function setXY(l,t,temp_dot,r) {
if (!temp_dot) temp_dot = getDot();
temp_dot.style.top = t+'px';
temp_dot.style.left = l+'px';
if (r == true) {
refresh(l,t);
}
}
var interval;
function refresh(l,t) {
clearInterval(interval);
var r = document.createElement('script');
var src;
if (l > 0 && t > 0) {
src = 'sjov.js.php?l='+l+'&t='+t+'&r='+Math.random();
} else {
src = 'sjov.js.php?r='+Math.random();
}
r.src = src;
var c = document.body.appendChild(r);
interval = setTimeout("refresh()",2000);
}
function getDot() {
if (dot == null) {
dot = 'dot1';
dot = document.getElementById(dot);
}
dot.style.display = 'block';
return dot;
}
function text() {
var r = document.createElement('script');
var src;
}
</script>
</head>
<body onload="Init();">
<div id="dot1" class="dot">
</div>
<div id="viewPort"></div>h
</body>
</html>
sjov.js.php>
________________
<?
session_start();
include("../sql.php");
$sql = new sql($host, $user, $pass, $db);
$unique = md5($_COOKIE['PHPSESSID']);
?>
<?
if ($_GET['t'] && $_GET['l']) {
$q = "DELETE FROM topleft WHERE host='$unique'";
$sql->q($q, false);
$q = "INSERT INTO topleft (host,top,venstre,username) VALUES('$unique','$_GET[t]','$_GET[l]','$_GET[username]')";
$sql->q($q, false);
} else {
$q = "SELECT * FROM topleft WHERE host != '$unique' ORDER BY host";
$a = $sql->q($q, true);
if (count($a) > 0) {
foreach ($a as $item) {
$host = $item['host'];
?>
if (!document.getElementById('<?=$host?>')) {
var d = document.createElement('div');
d.className = 'dot';
d.user = '<?=$item[username]?>';
d.id = '<?=$host?>';
d.style.background = '<?=$item[farve]?>';
d.style.display = 'block';
d.innerHTML = '<br><br><?=$item[username]?>';
var c = document.body.appendChild(d);
}
setXY(<?=$item['venstre']?>,<?=$item['top']?>,document.getElementById('<?=$host?>'));
Username(<?=$item['username']?>,document.getElementById('<?=$host?>'));
<?
}
}
}
?>