質問
サイトでYUIリッチテキストエディターを使用しています。 GoogleのロードJavaScriptを使用してロードしています。リンク(または<!> quot; settings <!> quot;ボックスを作成する他のアクションを作成しようとすると、タイトルバーが表示されません。写真はこちら。こちらのYUIのYahooサイト。
<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>
解決
YUI RTEの開発者の1人であるDavid Glassから助けを得ました。私が犯したエラーは実際にはCSSの問題で、CSSファイルでは<!> quot; h3 {visibility:hidden;} <!> quot;このエラーが発生しました。なんとか、助けてくれてありがとう!
他のヒント
エディターに自分のタイトルを強制する:
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 (同じ起源ポリシー)のためにGoogleでホストされているJavaScriptがDOMを変更できるとは思わない(Googleでない限り)。
WebサーバーにJavaScriptを配置し、そこからリンクしてみてください:
<script type="text/javascript" src="http://your.web.server.com/yui/2.7.0/build/yuiloader/yuiloader-min.js"></script>
所属していません StackOverflow