Hi every body
this code that is a part of my applicationn, don't work on the tizen device while it work normally on the tizen simultor ... can any one have a look and tell me why !! if it's a problem with the balise form or with the dom parser ! can anyone tell me how to solve it ?
thx
<!DOCTYPE html> <head> </head> <body> <div id="result"> </div> <div align="center"> <form name="myForm"> <button type="submit">go</button> </form> </div> <script> //var doc; var xhr = new XMLHttpRequest(); xhr.open('GET', 'http://www.sntri.com.tn/html_ar/result_tarif_horaire_sntri.php', true); //xhr.setRequestHeader('Origin', 'www.sntri.com.tn'); //xhr.setRequestHeader('Allow-Control-Allow-Origin', '*'); xhr.send(); xhr.onreadystatechange = function() { if(4 === xhr.readyState) { if(200 === xhr.status) { var parser = new DOMParser(); var doc = parser.parseFromString(xhr.responseText, 'text/html'); var myForm = document.forms.myForm; //console.log(doc); var selectDep = doc.getElementsByName('code_arret_dep')[0]; var selectArr = doc.getElementsByName('code_arret_arr')[0]; doc.getElementBy //console.log(select); myForm.appendChild(selectDep); myForm.appendChild(selectArr); //console.log(xhr.responseText); myForm.onsubmit = function(e) { e.preventDefault(); var xhr = new XMLHttpRequest(); xhr.open('POST', 'http://www.sntri.com.tn/html_ar/result_tarif_horaire_sntri.php', true); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.send('code_arret_dep='+selectDep.value+'&code_arret_arr='+selectArr.value); xhr.onreadystatechange = function() { if(4 === xhr.readyState) { if(200 === xhr.status) { var parser = new DOMParser(); var doc = parser.parseFromString(xhr.responseText, 'text/html'); var result = document.getElementById('result'); var tablex = doc.getElementById('tablex'); //console.log(doc); result.appendChild(tablex); //console.log(xhr.responseText); } } } console.log(selectDep.value); console.log(selectArr.value); } } } }; </script> </body> </html>