topical media & game development
#ajax-info.cfg / cfg
<script language=javascript>
var xmlHttp@qid
show info
function show@qid(str)
{
xmlHttp@qid=GetXmlHttpObject@qid()
if (xmlHttp@qid==null)
{
alert ("Browser does not support HTTP Request")
return
}
//var url="ajax-info.xml"
var url="@url"
//url=url+"?q="+str
//url=url+"&sid="+Math.random()
xmlHttp@qid.onreadystatechange=stateChanged@qid
xmlHttp@qid.open("GET",url,true)
xmlHttp@qid.send(null)
}
state
function stateChanged@qid()
{
if (xmlHttp@qid.readyState==4 || xmlHttp@qid.readyState=="complete")
{
document.getElementById("txt-@qid").innerHTML=xmlHttp@qid.responseText
}
}
function GetXmlHttpObject@qid()
{
var xmlHttp@qid=null;try
{
// Firefox, Opera 8.0+, Safari
xmlHttp@qid=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp@qid=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp@qid=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp@qid;
}
</script>
<span id="txt-@qid"> <b>info @qid/@url should be listed here.</b> </span>
<script>show@qid()</script>
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.