//打开和关闭左栏
function $SHleft(id){
if($(id).style.display=='none'){
$(id).style.display='block';
$("content").style.width='550px';
$F("sh","隐藏左栏");
}
else{
$(id).style.display='none';
$("content").style.width='750px';
$F("sh","打开左栏");
}
}
//打开和关闭评论
function $PL(id,plid){
if($("rp"+id).style.display=='none'){
$("rp"+id).style.display='block';
$F("pl"+id,"隐藏评论");
replycon(id,"rp"+id);
}
else{
$("rp"+id).style.display='none';
$F("pl"+id,"查看评论");
}
}
//显示日志
function show(id,pageid,rq){
var ajaxobj=new AJAX();
ajaxobj.method="GET";
ajaxobj.loadid="loadnews";
ajaxobj.url="lib.asp?action=show&sid="+id+"&rq="+escape(rq)+"&page="+pageid;
ajaxobj.callback=function(){
$F("bkcon",ajaxobj.gettext());
}
ajaxobj.send();
}
//显示日志分类列表
function board(){
var ajaxobj=new AJAX();
ajaxobj.method="GET";
ajaxobj.loadid="loadnews";
ajaxobj.url="lib.asp?action=board";
ajaxobj.callback=function(){
$F("blogcon",ajaxobj.gettext());
}
ajaxobj.send();
}
//取得评论内容
function replycon(rid,rpid){
var ajaxobj=new AJAX();
ajaxobj.method="GET";
ajaxobj.loadid="loadnews";
ajaxobj.url="lib.asp?action=replycon&rid="+rid;
ajaxobj.callback=function(){
$F(rpid,ajaxobj.gettext());
}
ajaxobj.send();
}
//取得评论数量
function plnum(rid){
var ajaxobj=new AJAX();
ajaxobj.method="GET";
ajaxobj.loadid="loadnews";
ajaxobj.url="lib.asp?action=plnum&rid="+rid;
ajaxobj.callback=function(){
$F("plnum"+rid,ajaxobj.gettext());
}
ajaxobj.send();
}
//加载发表评论表单
function rform(rid){
var ajaxobj=new AJAX();
ajaxobj.method="GET";
ajaxobj.loadid="loadnews";
ajaxobj.url="lib.asp?action=rform&rid="+rid;
ajaxobj.callback=function(){
$F("plform"+rid,ajaxobj.gettext());
}
ajaxobj.send();
}
//添加评论内容
function savepl(rid){
var ajaxobj=new AJAX();
ajaxobj.method="POST";
ajaxobj.loadid="loadnews";
ajaxobj.url="lib.asp?action=savepl&";
ajaxobj.data="rid="+rid+"&username="+escape($("username"+rid).value)+"&con="+escape($("con"+rid).value);
ajaxobj.callback=function(){
$F("tjpl"+rid,ajaxobj.gettext());
if (ajaxobj.gettext().indexOf("评论已提交成功")>=0) {
//如果评论提交成功则关闭表单、重新取得评论的数量。关闭成功提示信息
$CS("rform"+rid,"none");
plnum(rid);
pltjid="pltjsuc"+rid;
setTimeout('$CS(pltjid,"none")',1000);
}
}
ajaxobj.send();
}
//显示日历
function rl(ReqDate){
var ajaxobj=new AJAX();
ajaxobj.method="GET";
ajaxobj.loadid="loadnews";
ajaxobj.url="lib.asp?action=rl&ReqDate="+ReqDate;
ajaxobj.callback=function(){
$F("calendarcon",ajaxobj.gettext());
}
ajaxobj.send();
}
//显示留言表单
function gb(){
var ajaxobj=new AJAX();
ajaxobj.method="GET";
ajaxobj.loadid="loadnews";
ajaxobj.url="lib.asp?action=gb";
ajaxobj.callback=function(){
$F("gbform",ajaxobj.gettext());
}
ajaxobj.send();
}
//提交留言
function savegb(){
var gbusername=$("gbusername").value;
var gbemail=$("gbemail").value;
var gbcon=$("gbcon").value;
//alert($("gbusername").value);
//alert($("gbemail").value);
//alert($("gbcon").value);
//return false;
if (gbusername==""){
$CS("gberr","block");
$F("gberr","请署上你的大名");
setTimeout('$CS("gberr","none")',2000);
return false;
}
if (gbemail==""){
$CS("gberr","block");
$F("gberr","请写上你的邮箱");
setTimeout('$CS("gberr","none")',2000);
return false;
}
if (gbcon==""){
$CS("gberr","block");
$F("gberr","请发表你的意见");
setTimeout('$CS("gberr","none")',2000);
return false;
}
var ajaxobj=new AJAX();
ajaxobj.method="POST";
ajaxobj.loadid="loadnews";
ajaxobj.url="lib.asp?action=addgb&";
ajaxobj.data="username="+escape(gbusername)+"&email="+escape(gbemail)+"&con="+escape(gbcon);
ajaxobj.send();
ajaxobj.callback=function(){
if (ajaxobj.gettext().indexOf("成功")>=0) {
$SHwin("gb");
showgb(1);
}
}
}
//显示留言
function showgb(pageid){
var ajaxobj=new AJAX();
ajaxobj.method="GET";
ajaxobj.loadid="loadnews";
ajaxobj.url="lib.asp?action=showgb&page="+pageid;
ajaxobj.callback=function(){
$F("bkcon",ajaxobj.gettext());
}
ajaxobj.send();
}
Ajax Blog 用到的几个函数第1/3页(2)
内容版权声明:除非注明,否则皆为本站原创文章。