why this javascript doesn't work. Just shows an empty dialog box
the pkg.html retruns some plain text
i am really noob in javascript please helpCode:function get_data(url) { var http = new XMLHttpRequest() ; var result = ""; http.open("GET", url, true); http.setRequestHeader("Connection", "close"); http.onreadystatechange = function() {//Call a function when the state changes. if(http.readyState == 4 || http.readyState == "complete") { result=http.responseText; } } http.send(null); return result; } /*]]>*/ var result = ""; result=get_data("pkg.html") alert(result);


LinkBack URL
About LinkBacks
Reply With Quote

