题
我在我的网站上使用YUI Rich Text编辑器。我正在使用Google的加载javascript加载它。当我尝试创建一个链接(或任何其他创建<!>“设置<!>”框的操作时,标题栏丢失,请参阅图片在这里。你可以看到它应该如何查看这里。
我在<head>
- 标签中使用此代码:
<!--Include YUI Loader: -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/yui/2.7.0/build/yuiloader/yuiloader-min.js"></script>
<!--Use YUI Loader to bring in your other dependencies: -->
<script type="text/javascript">
// Instantiate and configure YUI Loader:
(function() {
var loader = new YAHOO.util.YUILoader({
base: "http://ajax.googleapis.com/ajax/libs/yui/2.7.0/build/",
require: ["editor"],
loadOptional: true,
combine: false,
filter: "MIN",
allowRollup: true,
onSuccess: function() {
var Editor = new YAHOO.widget.Editor('content', {
height: '300px',
width: '802px',
dompath: true, //Turns on the bar at the bottom
animate: true //Animates the opening, closing and moving of Editor windows
});
Editor.render();
}
});
// Load the files using the insert() method.
loader.insert();
})();
</script>
在我的网页上:
<div class="sIFR-ignore yui-skin-sam">
<textarea name="content" id="content" cols="50" rows="10">
</textarea>
</div>
解决方案
我从YUI RTE的开发人员David Glass那里得到了一些帮助。我犯的错误实际上是一个CSS的东西,有些在我的CSS文件中,它是一行读取<!>“h3 {visibility:hidden;} <!>”;这造成了这个错误。如何,谢谢你的帮助!
其他提示
尝试强制编辑自己的标题:
var Editor = new YAHOO.widget.Editor('content', {
height: '300px',
width: '802px',
dompath: true, //Turns on the bar at the bottom
animate: true //Animates the opening, closing and moving of Editor windows
});
Editor._defaultToolbar.titlebar="<b>Use my title</b>";
Editor.render();
我可能在这里错了,但由于 SOP (同源政策),我不知道我认为在谷歌托管的JavaScript将能够修改DOM(除非你是谷歌)。
尝试将JavaScript放入您的网络服务器并从那里进行链接:
<script type="text/javascript" src="http://your.web.server.com/yui/2.7.0/build/yuiloader/yuiloader-min.js"></script>
不隶属于 StackOverflow