YUI 中缺少标题栏

发布于 2024-07-24 21:13:41 字数 1626 浏览 4 评论 0原文

我在我的网站上使用 YUI 富文本编辑器。 我正在使用 Google 的加载 javascript 加载它。 当我尝试创建链接(或创建“设置”框的任何其他操作时,标题栏丢失,请参阅 图片,您可以看到它的外观 这里在YUI的Yahoos网站上。

我在-标签中使用此代码:

<!--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>

I'm using the YUI Rich Text editor on my site. I'm loading it using the load javascript from Google. When I try to create a link (or any other action that creates an "settings" box, the title bar is missing, see picture here. You can see how it supposed to look over here at Yahoos site for YUI.

I'm using this code in the <head>-tag:

<!--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> 

And in my webpage:

<div class="sIFR-ignore yui-skin-sam">
    <textarea name="content" id="content" cols="50" rows="10">
    </textarea>
</div>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

孤千羽 2024-07-31 21:13:41

我从 YUI RTE 的开发者之一 David Glass 那里得到了一些帮助。 我犯的错误实际上是一个CSS问题,在我的CSS文件中的某些地方,有一行“h3 {visibility:hidden;}”导致了这个错误。 无论如何,谢谢你的帮助!

I got some help from David Glass, one of the developers of YUI RTE. The error I had make was actually an CSS thing, some where in my CSS-files it was a line that read "h3 {visibility: hidden;}" which made this error. Any how, thanks for your help!

夜无邪 2024-07-31 21:13:41

尝试为编辑器强制使用自己的标题:

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(); 

Try forcing your own title for the editor:

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(); 
懵少女 2024-07-31 21:13:41

我在这里可能是错的,但是,由于SOP(同源政策),我不认为Google 托管的 JavaScript 将能够修改 DOM(除非你是 google)。

尝试将 JavaScript 放入您的网络服务器并从那里进行链接:

<script type="text/javascript" src="http://your.web.server.com/yui/2.7.0/build/yuiloader/yuiloader-min.js"></script> 

I might be wrong here but, due to SOP (Same Origin Policy) I don't think JavaScript hosted in Google will be able to modify the DOM (unless you are google).

Try placing JavaScript in your web server and linking from there:

<script type="text/javascript" src="http://your.web.server.com/yui/2.7.0/build/yuiloader/yuiloader-min.js"></script> 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文