function createObject() { var tipo_richiesta; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ tipo_richiesta = new ActiveXObject("Microsoft.XMLHTTP"); }else{ tipo_richiesta = new XMLHttpRequest(); } return tipo_richiesta; } var http = createObject(); function invia_dati(car,arrival,arrivalplace,parture,partureplace,startDay,startMonth,startYear,startHour,startMinute,startDay2,startMonth2,startYear2,startHour2,startMinute2) { // add image progress var par = window.parent.document; var images = par.getElementById('dati'); var new_div = par.createElement('div'); var new_img = par.createElement('img'); new_img.src = 'images/loading.gif'; new_div.appendChild(new_img); images.appendChild(new_div); http.open('post', 'add-car-cart.php?action=add&car='+car+'&arrival='+arrival+'&arrivalplace='+arrivalplace+'&parture='+parture+'&partureplace='+partureplace+'&startDay='+startDay+'&startMonth='+startMonth+'&startYear='+startYear+'&startHour='+startHour+'&startMinute='+startMinute+'&startDay2='+startDay2+'&startMonth2='+startMonth2+'&startYear2='+startYear2+'&startHour2='+startHour2+'&startMinute2='+startMinute2+'&cosa=Add to list'+''); http.onreadystatechange = handleResponse; http.send(null); } function handleResponse() { if(http.readyState == 4){ var response = http.responseText; document.getElementById('dati').innerHTML = response; } }