nie potrafię sobie poradzić z tym błędem,
function checked(dane) { var xhr = createXMLHttpRequest(); var zwrot; xhr.onreadystatechange = function() { if (xhr.readyState==4) { // Obsługa żądania została zakończona if (xhr.status==200) { zwrot=xhr.responseText; return zwrot; } else { alert("Wystąpił błąd "+xhr.status); } } } xhr.open("POST", "checked.php", true); xhr.send("word="+dane); } function zamien(ktory,val) { if(confirm("Czy na pewno chcesz umieścić firmę \""+val+"\" na pozycji "+ktory+" w polecamy?", "","")) { var passWord=prompt("Podaj hasło administratora :",""); if(checked(passWord)) { var xhr = createXMLHttpRequest(); xhr.onreadystatechange = function() { if (xhr.readyState==4) { // Obsługa żądania została zakończona if (xhr.status==200) { alert(xhr.responseText); } else { alert("Wystąpił błąd "+xhr.status); } } } xhr.open("POST", "zamien.php", true); xhr.send("word="+ktory+"||"+val); } } } unction createXMLHttpRequest() { try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) {} try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} try { return new XMLHttpRequest(); } catch(e) {} alert("Brak obsługi XMLHttpRequest"); return null; } function gebi(id) { return document.getElementById(id); }
i wywołanie checked(passWord) wyświetla undefined czy ktoś może z tym pomóc?