| looking for a brokerage account or IRA... click here | Add To Favorites |
| return to index | |
|
AJAX Javascript Functions The following Javascript can be used to execute AJAX calls and change the inner HTML of an object (like DIV) with the specified ID. To implement a DIV Tag simply have an area like the following Then to execute the object change, in an onClick, onMouseover, etc. have the action be executeObjectChange('getNewContent.php','innerHTMLReplacement')
var xmlHttp
var id
function executeObjectChange(url,newid)
{
xmlHttp=GetXmlHttpObject()
id=newid
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function stateChanged ()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
document.getElementById(id).innerHTML=xmlHttp.responseText;
}
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
//Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
Additional Interesting Articles t-SQL Cursor ©2008 AndrewKimball.com |
|