r GET method,loader should send NULL
}
loader.open(method,url,true);
if (method=="POST")
{
loader.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
}
loader.onreadystatechange=function(){
if (loader.readyState==1)
{
container.innerHTML=loading_msg;
}
if (loader.readyState==4)
{
container.innerHTML=loader.responseText;
}
}
loader.send(request);
}
//@desc transform the elements of a form object and their values into request string( such as "action=1&name=surfchen")
//@param form_obj the form object
//@usage formToRequestString(document.form1)
//@notice this function can not be used to upload a file.if there is a file input element,the func will take it as a text input.
// as I know,because of the security,in most of the browsers,we can not upload a file via xmlhttp.
// a solution is iframe.
//@author SurfChen <surfchen@gmail.com>
//@url http://www.surfchen.org/
//@license http://www.gnu.org/licenses/gpl.html GPL
function formToRequestString(form_obj)
{
var query_string='''';
var and='''';
//alert(form_obj.length);
for (i=0;i<form_obj.length ;i++ )
{
e=form_obj[i];
if (e.name!='''')
{
if (e.type==''select-one'')
{
ele