为什么这个jquery的append追加函数,能显示汉字,但却不能显示图片?html也有作用了啊???
<!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN""http://www.w3.org/TR/html4/l...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Fixed Size Demo - CLEditor WYSIWYG HTML Editor</title>
<meta name="description" content="CLEditor is an open source jQuery plugin which provides a lightweight, full featured, cross browser, extensible, WYSIWYG HTML editor that can be easily added into any web site." />
<meta name="keywords" content="jquery plugin, wysiwyg, html, editor, cross browser, lightweight, open source" />
<link rel="stylesheet" type="text/css" href="jquery.cleditor.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery.cleditor.min.js"></script>
<script type="text/javascript" src="jquery.cleditor.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#input").cleditor()[0].focus();
});
</script>
</head>
<body>
<form id="0" action="" method="post" target="yframe" enctype="multipart/form-data">
<textarea id="input" name="input"></textarea>
<input type="submit" onclick="a()" value="提取">
<input type="submit" onclick="b()" value="设置">
<button type="button">请点击这里</button>
<script type="text/javascript">
function a()
{
var o = $("#input").cleditor()[0];//关键是这里获取第一个对象,否则upateFrame无法调用
//var a=o.selectedHTML();
var a=$('#input').html();
document.write(a);
}
function b()
{
var o = $("#input").cleditor()[0];//关键是这里获取第一个对象,否则upateFrame无法调用
$('#input').append('<h1>asdfasdfasdfad</h1><p>爱上带哦山东 爱卫会搜艾凡赫阿飞的话发 爱上对方奥苏分哈哈大四u范哈儿思考如何给敌法没见过发表过ioadfg打发</p><img alt="" src="images/a.gif" />');
o.updateFrame();
}
</script>
</form>
</body>
</html> 展开
<html>
<head>
<title>Fixed Size Demo - CLEditor WYSIWYG HTML Editor</title>
<meta name="description" content="CLEditor is an open source jQuery plugin which provides a lightweight, full featured, cross browser, extensible, WYSIWYG HTML editor that can be easily added into any web site." />
<meta name="keywords" content="jquery plugin, wysiwyg, html, editor, cross browser, lightweight, open source" />
<link rel="stylesheet" type="text/css" href="jquery.cleditor.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery.cleditor.min.js"></script>
<script type="text/javascript" src="jquery.cleditor.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#input").cleditor()[0].focus();
});
</script>
</head>
<body>
<form id="0" action="" method="post" target="yframe" enctype="multipart/form-data">
<textarea id="input" name="input"></textarea>
<input type="submit" onclick="a()" value="提取">
<input type="submit" onclick="b()" value="设置">
<button type="button">请点击这里</button>
<script type="text/javascript">
function a()
{
var o = $("#input").cleditor()[0];//关键是这里获取第一个对象,否则upateFrame无法调用
//var a=o.selectedHTML();
var a=$('#input').html();
document.write(a);
}
function b()
{
var o = $("#input").cleditor()[0];//关键是这里获取第一个对象,否则upateFrame无法调用
$('#input').append('<h1>asdfasdfasdfad</h1><p>爱上带哦山东 爱卫会搜艾凡赫阿飞的话发 爱上对方奥苏分哈哈大四u范哈儿思考如何给敌法没见过发表过ioadfg打发</p><img alt="" src="images/a.gif" />');
o.updateFrame();
}
</script>
</form>
</body>
</html> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询