をクリック
関数 ajax_init()
{
var ajax=false;
try {
ajax = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
ajax = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
ajax = false;
}
}
if (!ajax && typeof XMLHttpRequest!='未定義') {
ajax = new XMLHttpRequest();
}
ajax を返します。
}
関数 post_data()
{
var url = "/server/xml.php";
var show_check = document.getElementById("show_check");
var show_flag = document.getElementById("show_flag");
var ajax = ajax_init();
ajax.open("GET", url, true);
//var img = "
";
ajax.onreadystatechange = function()
{
if (ajax.readyState == 4 && ajax.status == 200)
{
var ret = ajax.responseText;
var show_info = eval(ret);
show_check.innerHTML = show_info[0].no1; // bsd
show_flag.innerHTML = show_info[0].no2; // wuddy
//alert("responseXML の値: " info[0].firstChild.data);
}
/*else
{
show.innerHTML = img;
}*/
}
ajax.send(null);
}