ajax 함수
여기저기서 보고 뜯어 고친 함수.
그냥 내가 다음에도 쓸 수 있도록 기록용이다.
function ajax(url,inputid){
var ajaxRequest=null
if(window.ActiveXObject) { //익스플로러일 때
try{
ajaxRequest=new ActiveXObject('Msxml2.XMLHTTP') //5.0이후
}
catch(e){
try{
ajaxRequest=new ActiveObject('Microsoft.XMLHTTP') //5.0
}
catch(e1){
ajaxRequest=null
}
}
}
else if(window.XMLHttpRequest){ //익스플로러 말구
try{
ajaxRequest=new XMLHttpRequest()
}
catch(e){
ajaxRequest=null
}
}
if(ajaxRequest==null){
alert('XMLHTTP 개체 생성 오류!')
}
ajaxRequest.open('POST',url,false)
ajaxRequest.setRequestHeader('Content-Type','application/x-www-form-urlencoded')
ajaxRequest.send('')
var strv=ajaxRequest.responseText
var tempspan=document.getElementById(inputid)
if(tempspan!=null){
tempspan.style.display=''
try{
tempspan.innerHTML=strv
}
catch(e){
tempspan.value=strv
}
}
}