url = document.location.href; xend = url.lastIndexOf("/") + 1; var base_url = url.substring(0, xend); var ajax_get_error = false; function ajax_do (element, functie, params) { //Ajax data is always retrieved by this php page url = 'http://www.batteryupgrade.com/include/ajax.php'; // Create new JS element var jsel = document.createElement('SCRIPT'); jsel.type = 'text/javascript'; jsel.src = url + '?element=' + element + '&functie=' + functie + '&' + params; // Append JS element (therefore executing the 'AJAX' call) document.body.appendChild (jsel); } function ajax_do_ssl (element, functie, params) { //Ajax data is always retrieved by this php page url = 'https://www.batteryupgrade.com/include/ajax.php'; // Create new JS element var jsel = document.createElement('SCRIPT'); jsel.type = 'text/javascript'; jsel.src = url + '?element=' + element + '&functie=' + functie + '&' + params; // Append JS element (therefore executing the 'AJAX' call) document.body.appendChild (jsel); }