/** * JavaScript for testing the browser of AJAX-compatiblity * -------------------------------------------------------------------- * $Revision:: $ * $Date:: $ * $Tag:: 0.2.1-FINAL $ * $Author:: $ * -------------------------------------------------------------------- * Copyright (c) 2003 - 2009 by Roland Haeder * Copyright (c) 2009 - 2012 by Mailer Developer Team * For more information visit: http://mxchange.org * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, * MA 02110-1301 USA */ // Everthing starts with 3 seconds by default var counter = 3; // Get the element var element = document.getElementById('counter'); // Holding the interval var ajaxTest = null; // Countdown function function ajaxTestCounter () { // Is there element set? if (element != null) { // Yes, then set the new counter value element.innerHTML = counter; } // END - if // Is there reached zero? if (counter < 1) { // Clear the interval clearInterval(ajaxTest); // Try to open AJAX window try { // Is the test passed? displayTestWindow('install', '#ajax_installer'); } catch (e) { // Exception caught (very bad, AJAX is not working) alert(e); } } else { // Count one down counter--; } } // Init counter test function initAjaxTest () { // Start the test ajaxTest = window.setInterval('ajaxTestCounter()', 1000); } // Start the test initAjaxTest();