Can someone help me figure out how to retrieve the value of value1 on my server-side ASP using Javascript? I am using this Ajax code but unsure of how to do it.
In my serverside code, I would like to have something like <% var newdata = value1 (which is the one from the serverside - which was sent here) %>
Please Help! Thank you in advance!
I know it's possible with PHP, but can someone guide me on how to do it with Javascript?
<script>
function ajaxNow(_data)
{
var xmlHttp;
try
{
/* Firefox, Opera 8.0+, Safari */
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
/* newer IE */
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
/* older IE */
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("Your browser is old and does not have AJAX support!");
return false;
}
}
}
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
/* this puts the value into an alert */
alert("Value read is: "+xmlHttp.responseText);
}
}
xmlHttp.open("GET","ajax_file.asp?value1="+_data,true);
xmlHttp.send(null);
}
</script>