Jump to content

magicadmin

Members
  • Posts

    17
  • Joined

  • Last visited

Posts posted by magicadmin

  1. What is the code for your wipegraffitiwall() function?And what happens if you just visit ./includes/graffiti.php?painttext=&adminreset=1&userwallwiped=1?
    The wipegraffitiwall() code is=
    // Wipe wall refresh function.function wipegraffitiwall() {	rfsh = new Date(); rfsh = "?"+rfsh.getTime()	document.images["graffitiwall"].src = "<?php echo $graffiti_image; ?>?"+rfsh	toggleLayer('hiddenLayerLoad');}

    It makes an image with the url in it lol...But it dose wipe the wall clean like its ment to.The problem is not all the time its only some times..Try itGraffiti Wall link

  2. Since you aren't actually POSTing any code to your PHP page, you might try using GET instead. Try changing your code from:
    xmlHttp.open("POST", url , true)xmlHttp.send(null)

    to:

    xmlHttp.open("GET", url , true);xmlHttp.send("");

    Done that but i still have the same problem
  3. Hi all,I want to send some info from a form to a php page without reloading the page,I have tried some AJAX but its not 100% right, it works some of the time but some times its crashing out my server, it make my CPU run at 100% so i think there is a big bug in it.

    var xmlHttpfunction clearwall(){var url="./includes/graffiti.php?painttext=&adminreset=1&userwallwiped=1"xmlHttp=GetXmlHttpObject(wallstateChanged)xmlHttp.open("POST", url , true)xmlHttp.send(null)} function wallstateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ wipegraffitiwall()} } function GetXmlHttpObject(handler){ var objXmlHttp=nullif (navigator.userAgent.indexOf("MSIE")>=0){ var strName="Msxml2.XMLHTTP"if (navigator.appVersion.indexOf("MSIE 5.5")>=0){strName="Microsoft.XMLHTTP"} try{ objXmlHttp=new ActiveXObject(strName)objXmlHttp.onreadystatechange=handler return objXmlHttp} catch(e){ alert("Error. Scripting for ActiveX might be disabled") return } } if (navigator.userAgent.indexOf("Mozilla")>=0){objXmlHttp=new XMLHttpRequest()objXmlHttp.onload=handlerobjXmlHttp.onerror=handler return objXmlHttp}}

    Dose any one know how to do this or whats up with my ajax??Thanks all

  4. Hi all,I'm trying to restart the countdown when the refresh part of the script works...refresh part...

    function refreshgraffiti() {	rfsh = new Date(); rfsh = "?"+rfsh.getTime()	document.images["graffitiwall"].src = "<?php echo $graffiti_image; ?>?"+rfsh	setTimeout("refreshgraffiti()", 20*1000)	display()}

    Countdown part...

    		<form name="countdown" action=""><input type="text" size="1" name="CountDown" title="Time Till Next Auto Wall Reload" alt="Time Till Next Auto Wall Reload" /></form> 			<script type="text/javascript"> 			 var milisec=0 			 var seconds=20 			 document.countdown.CountDown.value='0.0' 			function display(){ 			 if (milisec<=0){ 				milisec=9 				seconds-=1 			 } 			 if (seconds<=-1){ 				milisec=0 				seconds+=1 			 } 			 else 				milisec-=1 				document.countdown.CountDown.value=seconds+"."+milisec 				setTimeout("display()",100) 			} 			</script>

    What am i miss here ?? a little lost with it....Thanks

  5. Thanks scott, but by the looks of that code it still would not rememmber the last thing that was opened... its not a menu im doing.. its my admin panel...Im so lost with this javascript stuff :)

  6. <div id="nav" style="display:none">That will ensure the menu is always disabled when the page is first viewed or refreshed.
    I need it to remmember what the last menu that was used on page refresh.
    Create a function that hides all the menus before showing the one clicked. like:onclick="java script:hideAll();toggleItem('nav')"
    I would not know where to begin to do that... im so new to javascript.Thanks
  7. Right i have this working sort of.. but when i refresh the page it opens the menu then it closes it again once its been closed plus i would like it to have all of it closed when the page is first loaded???

        <script type="text/javascript">    function init()    {        var cookie = getCookie('collapse_obj');        if(cookie)        {            var values = cookie.split(',');            for(var i = 0; i < values.length; i++)            {                var itm = getItem(values[i]);                if(itm)                    itm.style.display = 'none';            }        }    }    function makeCookie(name, value)    {        var cookie = name + '=' + escape(value) + ';';        document.cookie = cookie;    }    function getCookie(name)    {        if(document.cookie == '')            return false;        var firstPos;        var lastPos;        var cookie = document.cookie;        firstPos = cookie.indexOf(name);        if(firstPos != -1)        {            firstPos += name.length + 1;            lastPos = cookie.indexOf(';', firstPos);            if(lastPos == -1)                lastPos = cookie.length;            return unescape(cookie.substring(firstPos, lastPos));        }        else            return false;    }    function getItem(id)    {        var itm = false;        if(document.getElementById)            itm = document.getElementById(id);        else if(document.all)            itm = document.all[id];        else if(document.layers)            itm = document.layers[id];        return itm;    }    function toggleItem(id)    {        itm = getItem(id);        if(!itm)            return false;        if(itm.style.display == 'none')            itm.style.display = '';        else            itm.style.display = 'none';        ////////////////////        cookie = getCookie('collapse_obj');        values = new Array();        newval = new Array();        add    = 1;        if(cookie)        {            values = cookie.split(',');            for(var i = 0; i < values.length; i++)            {                if(values[i] == id)                    add = 0;                else                    newval[newval.length] = values[i];            }        }        if(add)            newval[newval.length] = id;        makeCookie('collapse_obj', newval.join(','));        return false;    }    </script><body onload="init()"><div id="nav"> tables here</div><a href="#" onclick="java script:toggleItem('nav')">Show/hide Navgation</a>

    also i want to use 2 different images one for when its open and one for when its closed

    <a href="#" onclick="java script:toggleItem('main')"><img src="./images/up.gif" border="0"></a>

    <a href="#" onclick="java script:toggleItem('main')"><img src="./images/down.gif" border="0"></a>

    How do i get this to check if the window is up or down and the display the right one ???And anther thought... how can i have it so only one menu is open at one time... IE when one is opened the other closes????Thanks

  8. No one got any idea on how i can fix this ajax problem then?I really need it sorted asap...Please please please can some one help me.....I have been trying for a couple of weeks now but i really dont know how to sort it. :)

  9. No one got ant ideas?the funny thing is that this ajax is from this site and me thinking that w3c are the ones that set the coding standerds they would get it right lol so come on w3c sort it out :)

  10. Hi all,I am getting a mod_security error,

    [Tue Jun 13 13:37:11 2006] [error] [client 62.*.*.*] mod_security: read_post_payload: Content-Length not available! [hostname "www.graffitiwall.magic8ball.co.uk"] [uri "/includes/graffiti.php?painttext=test&adminreset=0"] [unique_id U3Ix@kMPIBIAAHz8J@EAAAAc][Tue Jun 13 13:37:11 2006] [error] [client 62.*.*.*] mod_security: Access denied with code 403. Pattern match "^$" at HEADER [hostname "www.graffitiwall.magic8ball.co.uk"] [uri "/includes/graffiti.php?painttext=test&adminreset=0"] [unique_id U3Ix@kMPIBIAAHz8J@EAAAAc]

    The problem is with my AJAX,

    var xmlHttpfunction addtag(str){ var painttext=document.getElementById("graffiti").painttext.valuevar url="includes/graffiti.php?painttext=" + painttextxmlHttp=GetXmlHttpObject(stateChanged)xmlHttp.open("POST", url , true)xmlHttp.send(null)} function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ refreshgraffitiwall()document.getElementById('bttnsubmit').disabled=tru  edocument.getElementById("graffiti").painttext.value=""} } function GetXmlHttpObject(handler){ var objXmlHttp=nullif (navigator.userAgent.indexOf("Opera")>=0){alert("This Graffiti Wall doesn't work in Opera") return }if (navigator.userAgent.indexOf("MSIE")>=0){ var strName="Msxml2.XMLHTTP"if (navigator.appVersion.indexOf("MSIE 5.5")>=0){strName="Microsoft.XMLHTTP"} try{ objXmlHttp=new ActiveXObject(strName)objXmlHttp.onreadystatechange=handler return objXmlHttp} catch(e){ alert("Error. Scripting for ActiveX might be disabled") return } } if (navigator.userAgent.indexOf("Mozilla")>=0){objXmlHttp=new XMLHttpRequest()objXmlHttp.onload=handlerobjXmlHttp.onerror=handler return objXmlHttp}}

    Its working fine in IE but i get the error if FF,Dose any one know where my problem is???Thanks.

×
×
  • Create New...