-
Javascript Insert
Hi all,
How do I insert the following data into a php file using AJAX
function AddCity()
{
itemID = document.form.ItemID.value;
countryID = document.form.refCountryID.value;
regionID = document.form.refRegionID.value;
cityID = document.form.refCityID.value;
var url = 'ajaxFunctions.php?itemID='+itemID+'&countryID='+countryID+'®ionID='+regionID+'&cityID='+cityID;
xmlHttp = new GetXmlHttpObject();
xmlHttp.open('GET', url , true);
xmlHttp.onreadystatechange=function()
{
if (xmlHttp.readyState == 4)
{
if (xmlHttp.status == 200)
{
}
}
}
xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlHttp.send(null);
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject('Msxml2.XMLHTTP');
}
catch (e)
{
xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');
}
}
return xmlHttp;
}
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks