0

私は自分のサイトでYUIリッチテキストエディタを使用しています。Googleのloadjavascriptを使用して読み込んでいます。リンク(または「設定」ボックスを作成するその他のアクション)を作成しようとすると、タイトルバーが表示されません。こちらの画像を参照してください。YUIのYahoosサイトで、リンクがどのように表示されるかを確認できます。

私はこのコードを<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> 

そして私のウェブページで:

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

3 に答える 3

1

YUI RTE の開発者の 1 人である David Glass に助けてもらいました。私が犯したエラーは、実際には CSS の問題でした。私の CSS ファイルでは、このエラーを引き起こした "h3 {visibility: hidden;}" という行がありました。とにかく、助けてくれてありがとう!

于 2009-06-28T18:35:17.537 に答える
0

エディターに独自のタイトルを強制してみてください。

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(); 
于 2009-06-22T00:48:55.360 に答える
-1

ここで間違っているかもしれませんが、SOP (Same Origin Policy) により、Google でホストされている JavaScript が DOM を変更できるとは思いません (あなたが Google でない限り)。

JavaScript を Web サーバーに配置して、そこからリンクしてみてください。

<script type="text/javascript" src="http://your.web.server.com/yui/2.7.0/build/yuiloader/yuiloader-min.js"></script> 
于 2009-06-20T20:23:37.790 に答える