Fork me on GitHub

FCKEditor出现类型不匹配: 'Server.HTMLEncode' 解决方法

程序如下:

1
2
3
4
5
6
7
8
9
10
Dim oFCKeditorIntro
Set oFCKeditorIntro = New FCKeditor
oFCKeditorIntro.BasePath = "../FCKeditor/"

oFCKeditorIntro.ToolbarSet = "Default"
oFCKeditorIntro.Width = "100%"
oFCKeditorIntro.Height = "350"
oFCKeditorIntro.Value = rs("Info")

oFCKeditorIntro.Create "Info"

无情滴出错了

Microsoft VBScript 运行时错误 错误 ‘800a000d’
类型不匹配: ‘Server.HTMLEncode’
/fckeditor.asp,行97

网上搜了一下,大都说是 rs(“Info”)内容有问题,然后提供了类似防SQL注入的解决方法,把xxxx非法字符做过滤处理

自己试了下,解决方法很简单

1
2
3
4
5
6
7
8
9
10
11
Dim oFCKeditorIntro,InfoText	'多定义个变量
InfoText = rs("Info") 'look
Set oFCKeditorIntro = New FCKeditor
oFCKeditorIntro.BasePath = "../FCKeditor/"

oFCKeditorIntro.ToolbarSet = "Default"
oFCKeditorIntro.Width = "100%"
oFCKeditorIntro.Height = "350"
oFCKeditorIntro.Value = InfoText 'look

oFCKeditorIntro.Create "Info"

相关文章推荐

如果觉得我的文章对您有用,可否请我喝杯速溶咖啡