iframe的问题,用了一天没有解决,郁闷!! parent.followTd10.innerHTML='内容1' + '内容2' + '内容3' +.....试试看 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 JavaScript 中的字符串内容如果需要换行要这么写:var a = "abc\def";因此你输出时也要把所有的换行前面加一个 \,替换一下就成了。 引起你这个问题的原因可能有一个就是你jsp输出的字符集不一致,在两个jsp里面分别加上<%@ page contentType="text/html; charset=GB2312" %>还有<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> alert一下innerhtml的内容,看是否含有“\r”,我原来就是这个问题。含有的话先将它过滤掉。 在iframe中的那个页,不能有<html>标记!如果有,要去掉! 是不是可以这样:1<iframe name=framexh width=200 height=200 style="display:none" border=0 frameborder=0 framespacing=0 marginheight=0 marginwidth=0></iframe><SCRIPT LANGUAGE="JavaScript"><!--framexh.location.replace('sjload.jsp?zh=<%=strZh%>');//--></SCRIPT>2.<%@ include file="common.jsp" %><%@ page import="java.sql.*"%><jsp:useBean id="conn" scope="page" class="gkgl.database.LinkSQL"/><jsp:useBean id="jsp" scope="page" class="gkgl.include.OutString"></jsp:useBean><html><head><meta http-equiv="Content-Language" content="zh-cn"><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><%String strZh=request.getParameter("zh");String strSql="select count(*) as fs,nvl(sum(sjze),0) as sjze from sk_spxx where zt=to_char(sysdate,'YYYYMMDD')||'"+strZh+"'";ResultSet Rsa=conn.executeQuery(strSql);out.println( "<SCRIPT LANGUAGE='JavaScript'>");Rsa.next();out.println("parent.window.yxje.innerText='"+Rsa.getString("sjze")+"'");out.println("parent.window.yxfs.innerText='"+Rsa.getString("fs")+"'");Rsa.close();conn.close();out.println( "</SCRIPT>");%><SCRIPT LANGUAGE="JavaScript"><!--window.location.replace('about:blank');//--></SCRIPT></BODY></HTML> 谁能给我一个兼容Win7的Dreamweaver8下载地址。 大家都来讨论一下对日外包中的MBB框架啊 helloer 论坛问题! 如何从jsp中抓取动态图? 初学者的疑问??? 关于ActiveXObject的问题 好像是事务,谁知道来说说 关于spring mvc开发利用aop记录日志的问题 jsp+javabean中分页显示纪录 asp只能在windows上运行吗,jsp可以在windows也可以在unix上运行吗 调用自己编写的一个bean结果提示找不到类 我用jbuilder8编写的applet小程序,在浏览器可以调用,但是没有数据。
var a = "abc\
def";
因此你输出时也要把所有的换行前面加一个 \,替换一下就成了。
你jsp输出的字符集不一致,
在两个jsp里面分别加上
<%@ page contentType="text/html; charset=GB2312" %>
还有
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
如果有,要去掉!
1
<iframe name=framexh width=200 height=200 style="display:none" border=0 frameborder=0 framespacing=0 marginheight=0 marginwidth=0></iframe>
<SCRIPT LANGUAGE="JavaScript">
<!--
framexh.location.replace('sjload.jsp?zh=<%=strZh%>');
//-->
</SCRIPT>
2.
<%@ include file="common.jsp" %>
<%@ page import="java.sql.*"%>
<jsp:useBean id="conn" scope="page" class="gkgl.database.LinkSQL"/>
<jsp:useBean id="jsp" scope="page" class="gkgl.include.OutString"></jsp:useBean>
<html><head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><%
String strZh=request.getParameter("zh");
String strSql="select count(*) as fs,nvl(sum(sjze),0) as sjze from sk_spxx where zt=to_char(sysdate,'YYYYMMDD')||'"+strZh+"'";
ResultSet Rsa=conn.executeQuery(strSql);
out.println( "<SCRIPT LANGUAGE='JavaScript'>");
Rsa.next();
out.println("parent.window.yxje.innerText='"+Rsa.getString("sjze")+"'");
out.println("parent.window.yxfs.innerText='"+Rsa.getString("fs")+"'");
Rsa.close();
conn.close();
out.println( "</SCRIPT>");
%>
<SCRIPT LANGUAGE="JavaScript">
<!--
window.location.replace('about:blank');
//-->
</SCRIPT>
</BODY>
</HTML>