|
|
// JavaScript Document
|
|
|
|
|
|
|
|
|
function AjaxHandler(Para,callback)
|
|
|
{
|
|
|
|
|
|
AjaxBase("/community/include/community-handler.asp","text","post",Para,callback);
|
|
|
}
|
|
|
|
|
|
function AjaxUrlHandler(url,Para,callback)
|
|
|
{
|
|
|
|
|
|
AjaxBase(url,"text","post",Para,callback);
|
|
|
}
|
|
|
|
|
|
function PageAjaxHandler(url,Para)
|
|
|
{
|
|
|
|
|
|
AjaxBase(url,"html","post",Para,function(html)
|
|
|
{
|
|
|
document.writeln(html);
|
|
|
// Initialise Facebox Modal window:
|
|
|
|
|
|
$('a[rel*=modal]').facebox(); // Applies modal window to any link with attribute rel="modal"
|
|
|
|
|
|
// Initialise jQuery WYSIWYG:
|
|
|
|
|
|
$(".wysiwyg").wysiwyg(); // Applies WYSIWYG editor to any textarea with the class "wysiwyg"
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
function AjaxBase(rurl,dtype,typep,Para,callback)
|
|
|
{
|
|
|
$.ajax({
|
|
|
type: typep,//"post",
|
|
|
dataType: dtype,//"text",//html
|
|
|
processData: false,
|
|
|
url: rurl,
|
|
|
data: Para ,
|
|
|
success:
|
|
|
function(msg){
|
|
|
callback(msg);
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
///把参数按Post形式提交到指定页面
|
|
|
///url:提交到的页面
|
|
|
///Para:提交参数 如:citylist=12,34,56 或多参数形 式pid=1314,1212,1231&citylist=12,34,56
|
|
|
///在指定url页面用form形式取值
|
|
|
function PagePostHandler(url,Para)
|
|
|
{
|
|
|
|
|
|
if(Para.indexOf("=") < 0 ) return false;
|
|
|
|
|
|
$("body").append(" <form action='"+ url +"' method='post' id='PageTmpform'></form>");
|
|
|
|
|
|
var tmpPara,FE= $("#PageTmpform");
|
|
|
|
|
|
if(Para.indexOf("&") < 0 )
|
|
|
{
|
|
|
tmpPara = Para.split("=");
|
|
|
if(tmpPara.length > 1)
|
|
|
{
|
|
|
FE.html("<input type='hidden' name='"+tmpPara[0]+"' value='"+tmpPara[1]+"'/>");
|
|
|
|
|
|
FE.submit();
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
var tmpParaList= Para.split("&"),fhtml="";
|
|
|
|
|
|
for(var i = 0 ;i< tmpParaList.length;i++)
|
|
|
{
|
|
|
tmpPara = tmpParaList(i).split("=");
|
|
|
if(tmpPara.length > 1)
|
|
|
{
|
|
|
fhtml +="<input type='hidden' name='"+tmpPara[0]+"' value='"+tmpPara[1]+"'/>";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
FE.html(fhtml);
|
|
|
FE.submit();
|
|
|
}
|
|
|
|
|
|
} |