在用的Discuz有个错误提示,打开来看IE6/IE7下提示“未结束的字符串常量”,IE8下提示“Unterminated string constant”。 去Discuz论坛上看看,有个帖子说是在/templates/default/viewthread.htm文件中查找
- <a href="java script:;" onclick="setCopy('{$thread[subject]}\n{$boardurl}viewthread.php?tid=$tid$fromuid', '{lang post_copylink}')" class="lightlink" />[{lang share_im}]</a><br /><br />
复制代码
替换为
- <a href="java script:;" onclick="setCopy('{$threadshare}\n{$boardurl}viewthread.php?tid=$tid$fromuid', '{lang post_copylink}')" class="lightlink" />[{lang share_im}]</a><br /><br />
复制代码
此贴说的是Discuz 7.1的问题。
Discuz 7.2的版本,查看一下viewthread.htm,已经是上面替换后的内容了。
仔细根据错误提示看看出错处的网页源码
- <a href="java script:;" onclick="setCopy('Another announce\nhttp://localhost/fis/forum/viewthread.php?tid=2', 'Thread URL has been Copy to clipboard<br />You can use "Ctrl + V" copy to QQ or MSN.')" class="lightlink" />[Share Friend by QQ or MSN]</a><br /><br />
复制代码
好吧 错误明显,是单引号和双引号交替使用,本该是字符串内的”变成了字符串标识符。
对比一下网页源码和程序源码,看来是post_copylink内容中带了”导致的,在templates/default/templates.lang.php中查找post_copylink,将
- 'post_copylink' => 'Thread URL has been Copy to clipboard<br />You can use "Ctrl + V" copy to QQ or MSN.',
复制代码
替换为
- 'post_copylink' => 'Thread URL has been Copy to clipboard<br />You can use Ctrl + V copy to QQ or MSN.',
复制代码
解决了,错误提示消失。
|