Jump to content

loveccb

Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

loveccb's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yes, you're correct requinix. I tried to summarize and inadvertently broke my own code. As it is: <html> <head> <script type="text/javascript"> function AJAXobject(div,type) { //javascript object that checks the report status of each ordered report and displays status in page div var that=this; var updating = false; //this.callback = function() {alert("timestamp " + timestamp);} if (type == "gauge") { //Set url var url = "common/getsummary.php"; var div_decision = document.getElementById(div); div_decision.innerHTML = "Calculating... <img src=\"images/ajax-loader.gif\" />"; } //Update function this.update = function(passData) { if (updating==true) { return false; } updating=true; var AJAX = null; if (window.XMLHttpRequest){ AJAX = new XMLHttpRequest(); }else if (window.ActiveXObject){ AJAX = new ActiveXObject("Microsoft.XMLHTTP"); } if (AJAX==null) { alert("Your browser doesn't support AJAX."); return false; } else { AJAX.onreadystatechange = function() { if (AJAX.readyState==4 && AJAX.status==200) { LayerID.innerHTML=AJAX.responseText; delete AJAX; updating=false; //that.callback(); } // End Ajax readystate check. } var timestamp = new Date().getTime(); var uri=urlCall+'?'+passData+'&timestamp='+(timestamp*1); AJAX.open("POST", uri, true); AJAX.send(null); return true; } } //end update function //----------------------------------------------------- var LayerID = document.getElementById(div); // the layer associated with this object. var urlCall = url; // the url associated with this object. } </script> </head> <body> <div id="div_gauge"></div> <script type="text/javascript"> var dec_gauge = new AJAXobject('div_gauge','gauge'); dec_gauge.update('id=100'); </script> </body> </html>
  2. Hello all. My AJAX object is running twice. I've done my best to debug it, but I seem to be missing something. The ajax page (getsummarydecision.php) loads simply sends an email and returns an image. When I run this page separately, only one email is sent. When I run this AJAX object, 2 emails are sent. Does anyone see anything obvious here? The html: <div id="div_gauge"></div> <script type="text/javascript"> var dec_gauge = new AJAXobject('gauge','div_gauge'); dec_gauge.update('id=100'); </script> The javascript: function AJAXobject(div,type) { //javascript object that checks the report status of each ordered report and displays status in page div var that=this; var updating = false; //this.callback = function() {alert("timestamp " + timestamp);} if (type == "gauge") { //Set url var url = "common/getsummary.php"; var div_decision = document.getElementById(div); div_decision.innerHTML = "Calculating... <img src=\"images/ajax-loader.gif\" />"; } //Update function this.update = function(passData) { if (updating==true) { return false; } updating=true; var AJAX = null; if (window.XMLHttpRequest){ AJAX = new XMLHttpRequest(); }else if (window.ActiveXObject){ AJAX = new ActiveXObject("Microsoft.XMLHTTP"); } if (AJAX==null) { alert("Your browser doesn't support AJAX."); return false; } else { AJAX.onreadystatechange = function() { if (AJAX.readyState==4 && AJAX.status==200) { LayerID.innerHTML=AJAX.responseText; delete AJAX; updating=false; that.callback(); } // End Ajax readystate check. } var timestamp = new Date().getTime(); var uri=urlCall+'?'+passData+'&timestamp='+(timestamp*1); AJAX.open("POST", uri, true); AJAX.send(null); return true; } } //end update function //----------------------------------------------------- var LayerID = document.getElementById(div); // the layer associated with this object. var urlCall = url; // the url associated with this object. }
  3. Hello forum, Some of my users are getting this error when loading a page. Warning: mysql_query(): Access denied for user 'apache'@'localhost' (using password: NO) in /var/www/vhosts/devsite.com/httpsdocs/include/spider_bcb.php on line 22 Warning: mysql_query(): A link to the server could not be established in /var/www/vhosts/devsite.com/httpsdocs/include/spider_bcb.php on line 22 The line of code in question makes a simple INSERT into the database. There are numorous other sql calls throughout the site and this is the ONLY place where this error arises. Any ideas what is happening here? I've checked that the correct credentials are being called here. Another note: This error message only appears sporadically. Many thanks.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.