让syntaxhighlighter识别由javascript添加的html?
我正在尝试制作一个所见即所得的编辑器。我希望能够在发布代码片段之前预览我放入网站的代码片段。我已经让syntaxhighlighter正常工作..但是我想更改页面上的HTML并具有syntaxhighlighter效果..
我已经尝试了这两种方法
$('#write').live('click', function() {
myOut.innerHTML = myText.value;
SyntaxHighlighter.all();
});
btnWrite.onclick = function()
{
myOut.innerHTML = myText.value;
SyntaxHighlighter.all();
}
SyntaxHighlighter.all() 看到代码片段在页面加载时添加..但是我似乎无法看到任何用户添加的代码片段。
I'm trying to make a wysiwyg editor of sorts.. I want to be able to preview code snippets I am putting into my website before posting them. I have gotten syntaxhighlighter to work properly.. But I want to change HTML on the page and have syntaxhighlighter effect that..
I have tried both of these methods
$('#write').live('click', function() {
myOut.innerHTML = myText.value;
SyntaxHighlighter.all();
});
btnWrite.onclick = function()
{
myOut.innerHTML = myText.value;
SyntaxHighlighter.all();
}
SyntaxHighlighter.all() sees the code snippets being added as the page loads.. But I can't seem to get it to see any user added code snippets.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论