主题:  为什么我的显示业不会换行,空格?

wuchang

职务:普通成员
等级:1
金币:0.0
发贴:3
#12004/12/11 23:02:59

相关文件:点这儿打开
麻烦大家帮忙看看漏在哪,非常感激!!!



蓝鲸

职务:版主
等级:5
金币:42.1
发贴:2614
#22004/12/12 2:30:15
把简要代码发上来,应该有个说明,并且说明代码错误可能发生在那一段。这样一轱轳叫别人下载,没人愿看的。要知道你不愿化时间整理,别人就更没时间了。


非常大鱼

wuchang

职务:普通成员
等级:1
金币:0.0
发贴:3
#32004/12/12 14:03:01
原来是这样。谢谢
问题是我不知道怎样修改以下代码,插入网页实现换行:
<%
function xhhtml(content)
{
xhhtml=content
if (content=""{
xhhtml=replace(xhhtml,chr(13),"<br>"
xhHtml=replace(xhHtml,chr(34),"&quot;"
xhHtml=replace(xhHtml,chr(32),"&nbsp;"
}
}
%>

要插入的网页
<%@LANGUAGE="javascript" CODEPAGE="936"%>
<!--#include file="Connections/conn.asp" -->
<%
var Recordset1 = Server.CreateObject("ADODB.Recordset";
Recordset1.ActiveConnection = MM_conn_STRING;
Recordset1.Source = "SELECT * FROM gb ORDER BY ID DESC";
Recordset1.CursorType = 0;
Recordset1.CursorLocation = 2;
Recordset1.LockType = 1;
Recordset1.Open();
var Recordset1_numRows = 0;
%>
<%
var Repeat1__numRows = -1;
var Repeat1__index = 0;
Recordset1_numRows += Repeat1__numRows;
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<link href="file:///E|/qiuzhi/database/css.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#669900" class="thin">
<tr>
<td colspan="2"><div align="center">查看留言</div></td>
</tr>
<% while ((Repeat1__numRows-- != 0) && (!Recordset1.EOF)) { %>
<tr>
<td width="24%">&nbsp;</td>
<td width="76%"><%=(Recordset1.Fields.Item("name".value)%></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><%=(Recordset1.Fields.Item("shijian".value)%></td>
</tr>
<tr>
<td height="21">&nbsp;</td>
<td><%=(Recordset1.Fields.Item("title".value)%></td>
</tr>
<tr>
<td>&nbsp;</td>
<td><%= Server.HTMLEncode((Recordset1.Fields.Item("content".value)) %></td>
</tr>
<tr bgcolor="#FFFFFF">
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<%
Repeat1__index++;
Recordset1.MoveNext();
}
%>
</table>

</body>
</html>
<%
Recordset1.Close();
%>


在javascript的asp页面中显示
错误类型:
Microsoft JScript 编译错误 (0x800A03F0)
缺少 {'
/qiuzhi/view.asp, line5
xhhtml=content



蓝鲸

职务:版主
等级:5
金币:42.1
发贴:2614
#42004/12/12 16:59:17
函数语法错误,少了个{号

换行符是chr(10)+chr(13),VB语法chr(10)&chr(13)


非常大鱼

缺缺

职务:管理员
等级:8
金币:41.0
发贴:9620
#52004/12/15 14:24:54
xhhtml.replace()..


到底是js还是vbs?