TypeError:this.editorDoc.open不是函数

时间:2014-05-19 08:42:15

标签: javascript php wysiwyg

尝试加载“jquery.wysiwyg.js”文件时出现此错误。 html文件

<textarea style="width:765px; height:300px; margin:10px 0 0 0" id="desp" name="description" cols="20" rows="5" ></textarea> javascript <script type="text/javascript"> (function($) { $('#desp').wysiwyg(); })(jQuery); </script>

1 个答案:

答案 0 :(得分:0)

基本示例HTML代码

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Example: Basic - jWYSIWYG</title>
<link rel="stylesheet" type="text/css" href="../lib/blueprint/screen.css" media="screen, projection" />
<link rel="stylesheet" type="text/css" href="../lib/blueprint/print.css" media="print" />
<!--[if lt IE 8]><link rel="stylesheet" href="../lib/blueprint/ie.css" type="text/css" media="screen, projection" /><![endif]-->
<link rel="stylesheet" href="../../jquery.wysiwyg.css" type="text/css"/>
<script type="text/javascript" src="../lib/jquery.js"></script>
<script type="text/javascript" src="../../jquery.wysiwyg.js"></script>
<script type="text/javascript" src="../../controls/wysiwyg.image.js"></script>
<script type="text/javascript" src="../../controls/wysiwyg.link.js"></script>
<script type="text/javascript" src="../../controls/wysiwyg.table.js"></script>
<script type="text/javascript">
(function($) {
    $(document).ready(function() {
        $('#wysiwyg').wysiwyg();
    });
})(jQuery);
</script>
</head>
<body><div class="container">
    <h1>jWYSIWYG</h1>
    <h2>Example: Basic</h2>
    <textarea id="wysiwyg" rows="5" cols="80"></textarea>

    <hr/>
    <a href="index.html">Index</a>
</div></body>
</html>