Parašė sgsdfgsdgs· 2009 Kov. 9 11:03:59
#1
Sweiki, persidariau v6 sgoutbox panele ant v7 jej jau bandet su tuo automatisku Refresh... kaip ir ok viskas tik man kazkodel nesirefreshina...
php kodus persidariau bet va su
javascript nk nesuprantu tik zinau kad kazkas netaip su linku nes isvis jokio tas reshish.js neduoda nei klaida meta nk...
shoutbox_panel.php priejimas prie javascripto:
echo "<script type='text/javascript' src='".INFUSIONS."shoutbox_panel/refresh.js'></script>";
echo "<body onload=\"ajax(page,'scriptoutput')\"></body>";
Refresh.js failo turinys
var page = "infusions/shoutbox_panel/sbrefresh.php";
function ajax(target)
{
// native XMLHttpRequest object
document.getElementById(target).innerHTML = 'sending...';
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
req.onreadystatechange = function() {ajaxDone(target);};
req.open("GET", url+"?sid="+Math.random(), true);
req.send(null);
// IE/Windows ActiveX version
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = function() {ajaxDone(target);};
req.open("GET", url+"?sid="+Math.random(), true);
req.send();
}
}
setTimeout("ajax(page,'scriptoutput')", 10000);
}
function ajaxDone(target) {
// only if req is "loaded"
if (req.readyState == 4) {
// only if "OK"
if (req.status == 200 || req.status == 304) {
results = req.responseText;
document.getElementById(target).innerHTML = results;
} else {
document.getElementById(target).innerHTML="ajax error:\n" +
req.statusText;
}
}
}
Manau kad 7versijai netinka tas linkas (var page = "infusions/shoutbox_panel/sbrefresh.php";) gal zinot ka pakeisti? Dekui visiems.
Redagavo sgsdfgsdgs· 2009 Kov. 9 11:03:21
Parašė sgsdfgsdgs· 2009 Kov. 14 00:03:58
#2
Nagi kasnors uzmeskit aky :) ar gali neveikti dar del to jog pjaunasi ant v7 kokie java scriptai? beje patikrinau daugiau joks modas pas mane nenaudoja js