| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 875 人关注过本帖
标题:框架页面不显示,那个语句的问题?
只看楼主 加入收藏
ccqwq99
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2007-5-18
结帖率:100%
收藏
 问题点数:0 回复次数:5 
框架页面不显示,那个语句的问题?
改了一个聊天室程序,增加图片上传功能,成功。可以是发布图片以后,框架下面的发言页面没有内容,不知如何是好?本人对js不熟,特请达人指点,谢了。
我在原发言页面增加了一个div,用来转换发言好上传表单,除了增加一个表单外,与未动,原页面名di.asp;原发言表单提交到spot.asp,我增加了一个imgbc.asp处理上传。结果出现了上述问题。
仔细比较spot和imgbc的区别,怀疑是spot调用了函数send(),而imgbc没有调用所致,该请各位费心看看。
function send()
{
var post_msg=document.af.post_msg.value
var msg=document.af.msg.value
  while(post_msg.indexOf(">") != -1 || post_msg.indexOf("<") != -1 || post_msg.indexOf(" ") != -1 || post_msg.indexOf(" ") != -1 || post_msg.indexOf(",") != -1 || msg.indexOf(" ") != -1 || msg.indexOf(" ") != -1 || msg.indexOf(",") != -1 || msg.indexOf("<") != -1 || msg.indexOf(">") != -1){
   post_msg = post_msg.replace(" ","");
   post_msg = post_msg.replace(" ","");
   post_msg = post_msg.replace(",","");
   post_msg = post_msg.replace("<","&lt;")
   post_msg = post_msg.replace(">","&gt;")
   msg = msg.replace(" ","");
   msg = msg.replace(" ","");
   msg = msg.replace(",","");
   msg = msg.replace("<","&lt;")
   msg = msg.replace(">","&gt;")
  }
if (msg==''){alert('请输入发言或动作!');document.af.msg.focus();return false}
if (msg==post_msg){alert('请不要重复发言!!');document.af.msg.focus();return false}
this.document.af.Submit.disabled=1;
this.document.af.post_msg.value=msg;
this.document.af.action='post.asp';
this.document.af.msg.value='';
this.document.af.addsign.value='0';
this.document.af.tu.value='0';
setTimeout('document.af.Submit.disabled=0',3000);
document.af.msg.focus();
}
搜索更多相关主题的帖子: JavaScript语句 
2009-08-14 18:42
ccqwq99
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2007-5-18
收藏
得分:0 
post.asp
<%Response.Buffer =true
if Session("MM_Username")="" then  
Response.Write "未登陆不能发言!"
Response.End
end if
send_time=now()
if Instr(Application("onlinelist"),Session("logname"))=0 then
Response.Write "<script>alert('您与服务器断开联接,请刷新页面!');</script>"
Response.End  
end if
if datediff("s",session("now"),send_time)<3 then
    Response.Write "<script>alert('两次发言时间需间隔3秒!');</script>"
    Response.End  
end if
'saystr=Request.Form ("post_msg")
    saystr=replace(Request.Form ("post_msg"),Chr(13) & Chr(10),"<br>")
    towho=Request.Form ("towho")
    addsays=Request.Form ("addsays")
    addwordcolor=Request.Form ("addwordcolor")
    sayscolor=Request.Form ("sayscolor")
    towhoway=Request.Form ("towhoway")
    gonggao=Request.Form ("gonggao")
    if sayscolor="" or addwordcolor="" then Response.End  
    if towho<>"大家" then  
        if Instr(LCase(Application("onlinelist")),LCase(towho&" "))=0 then
            Response.Write "<script>alert('"&towho&"目前己离开聊天室!');</script>"
            response.end
        end if
    end if
    if towhoway<>1 then towhoway=0
    if gonggao<>1 then gonggao=0
    if Instr(saystr,"[tu]")<>0 then
    dim reg
    set reg=new regexp
    reg.IgnoreCase=true
    reg.Global=true
    reg.Pattern="(\[tu\])([1234567890])(\[\/tu\])"
    saystr=reg.Replace(saystr,"<img src=logo/$2.gif>")
    reg.Pattern="(\[tu\]1)([1234567890])(\[\/tu\])"
    saystr=reg.Replace(saystr,"<img src=logo/1$2.gif>")
    set reg=nothing
    end if
     
    if towhoway=1 and (towho="大家" or towho=Session("logname")) then  
    Response.Write "<script>alert('不能对自己或大家私聊!');</script>"
    Response.End  
    end if
    act=0
    if left(saystr,2)="//" then  
    act=1
    saystr=mid(saystr,3,len(saystr))
    addsays=0
    else
    if addsays="" then  
    addsays="对"
    else
    addsays=addsays&"对"
    end if  
    end if
SayStr="parent.getmsg('"&Session("logname")&"','"&towho&"','"&addsays&"','"&saystr&"','"&act&"','"&addwordcolor&"','"&sayscolor&"','"&towhoway&"','"&now()&"','"&gonggao&"');"
Application.Lock
    sd=Application("chat_sd")
    line=int(Application("chat_line"))
    Application("chat_line")=line+1
    Dim newsd(200)
    j=0
    for i=3 to 200 step 3
        newsd(j)=sd(i)
        newsd(j+1)=sd(i+1)
        newsd(j+2)=sd(i+2)
        j=j+3
    next
    newsd(198)=line+1
    newsd(199)=SayStr
    newsd(200)=session("zl")
    Application("chat_sd")=newsd
Application.UnLock
sd=Application("chat_sd")
newuserline=0
for i=0 to 200 step 3
    newuserline=sd(i)
    if sd(i)>session("chat_line")  then
        Response.Write "<script language=javascript>"&sd(i+1)&"</script>"
        Response.Write "<script language=javascript>"&sd(i+2)&"</script>"
    end if
next
session("chat_line") = newuserline
session("now") = send_time
Response.End
%>
2009-08-14 18:45
ccqwq99
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2007-5-18
收藏
得分:0 
imgbc.asp
<%
If Session("MM_Username") = "" then Response.Redirect("/zhuce/dl_wdl.htm")
%>
<!--#include file="../inc/myconnection_h.inc"-->
<!--#include file="../inc/upload.inc"--><%'上传文件所需的类函数%>
<%
Response.Buffer =true
 
'用户id唯一,一秒钟内同一用户不可能上传两次,比随机数强。20090814
set rs=myconnection.execute("select id from [zhuce] where a1='"&Session("MM_Username")&"'")
    id=rs(0)
set rs=nothing
set Myconnection=nothing
 
dim upload,file,formName,formPath,iCount,filename,fileExt,Forum_upload
dim filename_temp
Forum_upload="jpg,gif,bmp,png" '可以在此定义上传文件格式,以,分割。允许的格式还包括:zip,png,swf,doc,txt,htm,html
set upload=new upload_5xSoft ''建立上传对象
 
'*************************************************获取说明标题、说明内容
img_explain_text=upload.form("explain_text")
'-----------------------判断上传数据是不符合要求
iCount=0
for each formName in upload.file ''列出所有上传了的文件
    set file=upload.file(formName)  ''生成一个文件对象
    if file.filesize<1 then '判断用户是否选择文件
        Response.Write "<script>alert('没有选择图片文件!!');</script>"
        Response.End  
    end if
    '************************************************
    if file.filesize>cint(500)*1000 then '判断要上传的文件大小是否超出限制,如果需要更改请将cint中的100改成所需数值
        Response.Write "<script>alert('上传的文件(图片)过大!');</script>"
        Response.End  
    end if
 
    fileExt=lcase(right(file.filename,4))
    uploadsuc=false
    Forumupload=split(Forum_upload,",")
    for i=0 to ubound(Forumupload)
        if fileEXT="."&trim(Forumupload(i)) then
        uploadsuc=true
        exit for
        else
        uploadsuc=false
        end if
    next
    if uploadsuc=false then '判断要上传文件的格式是否正确
        Response.Write "<script>alert('文件(图片)格式不合要求!');</script>"
        Response.End  
    end if
     
    randomize   'Randomize 语句 初始化随机数生成器。Randomize [number],如果省略 number,则使用系统计时器返回的值作为新的种子值。
    ranNum=int(90000*rnd)+10000   'Rnd 函数 返回一个随机数。
    filename="/upimgs/jiaoliutemp/"&cstr(id)&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&fileExt '设定新的文件名,可防止重名文件覆盖问题
     
    if file.FileSize>0 then         ''如果 FileSize > 0 说明有文件数据
        file.SaveAs Server.mappath(FileName)   ''保存文件
        iCount=iCount+1
    end if
    set file=nothing
next
set upload=nothing  ''删除此对象
 
'****此处可以添加标题、内容、文件名存入数据库代码。以下为示例代码***
'on error resume next
 
img_explain_text=server.htmlencode(img_explain_text)
img_explain_text=replace(img_explain_text,vbCrLf,"<br>")
img_explain_text=replace(img_explain_text," ","&nbsp;")
img_explain_text=replace(img_explain_text,"'","“")
img_explain_text=replace(img_explain_text,"""","“")
 
Application.Lock
SayStr="parent.f1.document.writeln('{"&Session("logname")&"] {发送图片}"&cstr(now())&" <br>"&img_explain_text&"<br><img src="&FileName&"><br>'); fayan();"
 
    sd=Application("chat_sd")
    line=int(Application("chat_line"))
    Application("chat_line")=line+1
    Dim newsd(200)
    j=0
    for i=3 to 200 step 3
        newsd(j)=sd(i)
        newsd(j+1)=sd(i+1)
        newsd(j+2)=sd(i+2)
        j=j+3
    next
    newsd(198)=line+1
    newsd(199)=SayStr
    newsd(200)=session("zl")
    Application("chat_sd")=newsd
Application.UnLock
sd=Application("chat_sd")
newuserline=0
for i=0 to 200 step 3
    newuserline=sd(i)
    if sd(i)>session("chat_line")  then
        Response.Write "<script language=javascript>"&sd(i+1)&"</script>"
        Response.Write "<script language=javascript>"&sd(i+2)&"</script>"
    end if
next
session("chat_line") = newuserline
session("now") = send_time
Response.End
%>
2009-08-14 18:46
ccqwq99
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2007-5-18
收藏
得分:0 
chat.asp
<%Response.Buffer=True%>
<!--#include file="config.asp"-->
<!--#include file="jlconn.asp"-->
<!--#include file="../inc/myconnection.inc"-->
<%
if Session("MM_Username")="" then
    Response.Redirect("/zhuce/dl_wdl.htm")
end if
'写入交流数据库,确定管理身份
Session.timeout=60
 
set rs =server.createobject("adodb.recordset")
sql="select * from [user] where name='"&Session("logname")&"'"
rs.open sql,jlconn,3,3
if rs.eof and rs.bof then
    rs.addnew
    set rs1 =server.createobject("adodb.recordset")
    sql="select a3,a6,a9,b1 from zhuce where a1='"&Session("MM_Username")&"'"
    rs1.open sql,myconnection,1,1
    rs("name")=rs1("a3")
    rs("lianxi")=rs1("a6")+" "+rs1("a9")
    rs("jianjie")=left(rs1("b1"),255)
    rs("logintime")=Now()
    rs.update
    session("zl")="parent.f1.document.writeln('&nbsp;&nbsp;&nbsp;&nbsp;"&Session("logname")&"简介:"&rs("jianjie")&"<br>&nbsp;&nbsp;&nbsp;&nbsp;"&Session("logname")&"联系:"&rs("lianxi")&"<P>');"
    set rs1=nothing
    set myconnection=nothing
else
    session("zl")="parent.f1.document.writeln('&nbsp;&nbsp;&nbsp;&nbsp;"&Session("logname")&"简介:"&rs("jianjie")&"<br>&nbsp;&nbsp;&nbsp;&nbsp;"&Session("logname")&"联系:"&rs("lianxi")&"<P>');"
    'session("zl")=rs("jianjie")+
    jlconn.execute("update [user] set logintime=Now() where name='"&Session("logname")&"'")
    if rs(2)=True then '双重严重管理权限
        chatmatname=split(mastername,"|")
        for i=0 to UBound(chatmatname)
            if Session("logname")=chatmatname(i) then
                session("chatadmin")=True
                exit for
            end if
        next
    end if
end if
   
if Application("chat_line")="" then  
     Dim sd_init(200)
     for i=0 to 197
     sd_init(i)=0
     next
     sd_init(198)=1
     sd_init(199)="数组初化成功!"
     Application("chat_sd")=sd_init
     Application("chat_line")=0
     Application("onlinelist")=""
end if
    session("chat_line")=Application("chat_line")
    session("now")=now()
    session("0")=0
if Instr(Application("onlinelist"),Session("logname")&" ")=0 then
    Application.lock
    Application("onlinelist")=Application("onlinelist")&Session("logname")&" "
    Application.UnLock
    if session("0")=0 then
        Application.lock
        sd=Application("chat_sd")
        Application("chat_line")=(Application("chat_line"))+1
        Dim newsd(200)
        j=0
        for i=3 to 200 step 3
            newsd(j)=sd(i)
            newsd(j+1)=sd(i+1)
            j=j+2
        next
        newsd(198)=Application("chat_line")
        newsd(199)="parent.getmsg('"&Session("logname")&"','大家','对','【公告】<a href=javascript:parent.seluser(\'"&Session("logname")&"\'); target=f2>"&Session("logname")&"</a>如风一样飘进了"&chatname&"!<bgsound src=type.wav loop=1>','2','AA00CC','AA00CC','0','"&now()&"<br>'); "
        Application("chat_sd")=newsd
        Application.UnLock
    end if
    session("0")=1
end if
 
ph = Request.ServerVariables("SCRIPT_NAME")
ph = Left(ph, Len(ph) - 8)
%>
<html>
<head>
<title><%=chatname%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language=javascript>
var username='<%=Session("logname")%>';
var autoScroll=1;
var lheight=140;
var fsize=10.5;
var bgcolor='#99ccff';
var chatimage='1';
var tbclu='true'
var ph = "<%=ph%>";
var masklist=' ';
function modifyname(str){username=str;}
function getname(){return username;}
function listmask(){f6.location.href='mask.asp?masklist='+masklist;}
function mask(un){if(masklist.indexOf(' '+un+' ')==-1){masklist=masklist+un+' ';}else{var regexp=eval('/ '+un+' /gi');masklist=masklist.replace(regexp,' ');}}
function getmasklist(){return(masklist);}
 
function cbg(){return bgcolor;}
function cbi(){ return ph + chatimage;}
function scrollit(){if(!parent.f2.document.af.as.checked){autoScroll=0;}else{autoScroll=1;parent.f1.autoscrollnow();parent.f0.autoscrollnow();}}
 
function getuser(){return username;}
function seluser(str){parent.f2.document.af.towho.value=str;parent.f2.document.af.msg.focus();}
 
function write()
{
parent.f1.document.open();
parent.f1.document.writeln("<html><head><title>分屏显示</title><meta http-equiv=Content-Type content=\"text/html; charset=gb2312\">");
parent.f1.document.writeln("<style type=text/css>.p{font-size:20pt}.l{line-height:" + lheight + "%}.t{color:Fshowmsg0FF;font-size:9pt;}body{font-family:\"宋体\";font-size:" + fsize + "pt;line-height:" + lheight + "%}INPUT{BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px; FONT-SIZE: 9pt; BORDER-BOTTOM-WIDTH: 1px; BACKGROUND-COLOR: #efefef; BORDER-RIGHT-WIDTH: 1px}A{text-decoration:none}div{background:#fdf5e6;line-height:" + lheight + "%}td{font-family:\"宋体\";font-size:" + fsize + "pt;}A:Hover{text-decoration:underline}A:visited{color:blue}</style></head>");
parent.f1.document.writeln("<body topmargin=3 bgcolor=#eeeeee>");
parent.f1.document.writeln("<\script>function autoscrollnow(){this.scroll(0,65000);}<\/script>");
parent.f1.document.writeln("<span class=l><font color=red>【系统提示】</font>欢迎【"+username+"】光临<%=chatname%>!</span><br>");
}
 
function getmsg(str1,str2,str3,str4,str5,str6,str7,str8,str9,str10,str11)
{
 
if(masklist.indexOf(' '+str1+' ')!=-1 && str2==username){return false}
 
if (str1==username)
{var zj="【<a href=javascript:parent.seluser('"+str1+"'); target=f2><font color="+str6+">我</font></a>】";}
else
{var zj="<a href=javascript:parent.seluser('"+str1+"'); target=f2><font color="+str6+">"+str1+"</font></a>";}
if (str2==username)
{var br="【<a href=javascript:parent.seluser('"+str2+"'); target=f2><font color="+str6+">我</font></a>】";}
else
{var br="<a href=javascript:parent.seluser('"+str2+"'); target=f2><font color="+str6+">"+str2+"</font></a>";}
msg=zj+str3+br+"说:<font color=red size=1pt>("+str9+")</font><br><font color="+str7+">"+str4+"</font><br>"
//私聊
if (str8=='1' && str11!='1'){msg="<font color=red>〖私聊〗</font>"+zj+str3+br+"说:<font color=red size=1pt>("+str9+")</font><br><font color="+str7+">"+str4+"</font><br>";}else{saystr=zj+str2+br+"说:<font color=red size=1pt>("+str9+")</font><br><font color="+str7+">"+str4+"</font><br>";}
//公告
if (str10=='1'){msg="<span class=l><font color=red>【系统提示】</font><font color="+str7+">"+str4+"</font></span>";}
//查看资料
if (str8=='1' && str11=='1'){msg="<span class=l><font color=red>〖用户资料查询〗</font><font color="+str7+">"+str4+"</font></span>";}
//动作
if (str5=='2') {
msg=str4
 
}
else
{
if (str5=='1'){for(th=1;th<4;th++){if(str1 == username){str4 = str4.replace("##", zj );}else{str4 = str4.replace("##", zj);}
if(str2 == username){str4 = str4.replace("%%", "<a href=javascript:parent.seluser('"+str2+"'); target=_parent><font color=red>【" + str2 + "】</font></a>");}else{str4 = str4.replace("%%", "<a href=javascript:parent.seluser('"+str2+"'); target=_parent><font color=FF0099>" + str2 + "</font></a>");}}
msg="<font color=008800>【动作】</font>"+zj+"<font color="+str7+">"+str4+"</font>";}
}
if (str8=='1' & (str1!=username && str2!=username)){return false}
if (str2==username)(msg=msg+"<bgsound src=type.wav loop=1>")
 
if ((tbclu=='true') && (str1==username || str2==username))
{parent.f1.document.writeln(msg)
if (autoScroll==1) {parent.f1.autoscrollnow();}
}
else
{parent.f0.document.writeln(msg)
if (autoScroll==1) {parent.f0.autoscrollnow();}
}
}
//分屏
function tbclutch()
{
if (tbclu=='true') {
this.msgfrm.rows="*,0";tbclu='false';
}
else
{
this.msgfrm.rows="1*,1*";tbclu='true';
}
this.f2.document.af.msg.focus();
}
</script>
</head>
    <frameset cols="*,180" border="0" framespacing="0" >  
      <frameset rows="*,150,0,0" cols="*" border="0" framespacing="0">  
          <frame src="about:blank" name="f1">
        <frame src="di.asp" name="f2" noresize scrolling="NO">
        <frame src="about:blank" name="f3" noresize frameborder="NO" scrolling="NO">
        <frame src="getmsg.asp" name="f4" noresize frameborder="NO" scrolling="NO">
      </frameset>
      <frameset rows="0,*,150,0" cols="*" border="0" framespacing="0">  
        <frame src="about:blank" name="f5" noresize frameborder="NO" scrolling="NO">
        <frame src="left.asp" name="f6" noresize>
        <frame src="cd.asp" name="f7" noresize scrolling="NO">
        <frame src="about:blank" name="f8" noresize frameborder="NO" scrolling="NO">
      </frameset>
    </frameset>
<noframes><body bgcolor="#FFFFFF" text="#000000">
</body></noframes>
</html>
<iframe name="tmp"></iframe>
<br><input type="checkbox" name="box">No Scroll
<script language="JavaScript">
setInterval("tmp.document.writeln(new Date().toLocaleString()+'<br>');if(!box.checked)tmp.document.body.scrollTop = tmp.document.body.scrollHeight;",1000);
</script>
2009-08-14 18:47
ccqwq99
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2007-5-18
收藏
得分:0 
截图,发布后不显示发言页面。

框架页面不显示.JPG (53.74 KB)
图片附件: 游客没有浏览图片的权限,请 登录注册
2009-08-14 18:52
ccqwq99
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2007-5-18
收藏
得分:0 
没有哪位达人帮我看一下?
今天打开ie script editor,没有错误提示。
看来还是那个语句限制了页面的读取???
2009-08-15 18:50
快速回复:框架页面不显示,那个语句的问题?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.137053 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved