<script>
function sendPost(formId,url,spanId)
{
var form = document.getElementById(formId);
//var ptUrl = document.getElementById(url);
var span = document.getElementById(spanId);
var postRequest = new String("");
var n,v;// n -> name , v -> value
for(var i=0;i
{
n = form.elements[i].name;
v = form.elements[i].value;
postRequest += escape(n) + '=' + escape(v) + '&';
}
var xmlhttp = new_xmlhttp();
xmlhttp.open("POST",url,true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=iso-8859-9");
xmlhttp.send(postRequest);
xmlhttp.function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
span.innerHTML = xmlhttp.responseText;
$('#message').show();
form.reset();
}
else
{
span.innerHTML = 'hata';
}
}
return false;
}
//
http://jibbering.com/2002/4/xmlhttp.js
function new_xmlhttp()
{
var xmlhttp;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp=false;
}
}
@else
xmlhttp=false;
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) {
xmlhttp=false;
}
}
return xmlhttp;
}
</script>