TinyMCEエディター(jQueryパッケージ)を使用しています。同じページで、jQueryUIタブも使用しています。私の問題は、ページがロードされた後にjQueryタブをレンダリングしようとすると、エラーメッセージg.splitが関数ではなく、タブがレンダリングされないことです。ただし、ページの読み込み時にタブをレンダリングすると、すべてが正常に機能しています。この問題は、TinyMCEオブジェクトがレンダリングされたときにのみ発生するようです。
だから、この問題は私を夢中にさせています。どんな助けでも大歓迎です。
問題を再現するために、最小限のhtmlサンプルページを作成しました。ボタンをクリックすると、タブオブジェクトがレンダリングされないことがわかり、エラーメッセージが表示されます。反対側では、jQueryボタンが正しくレンダリングされています。したがって、この問題は私のjQueryタブオブジェクトでのみ発生するようです。
<html>
<head>
<title>test 1</title>
<link type="text/css" href="css/custom/jquery-ui.custom.css" rel="stylesheet"/>
<script type="text/javascript" src="js/jquery-min.js"></script>
<script type="text/javascript" src="js/jquery-ui-custom-min.js"></script>
<script type="text/javascript" src="js/tiny_mce/jquery.tinymce.js"></script>
<script type="text/javascript">
function render_my_jquery_ui_objects()
{
$("#my_button_1" ).button();
$("#my_tabs").tabs();
return true;
}
$().ready(function() {
$('#my_editor_1.tinymce').tinymce({
script_url : 'js/tiny_mce/tiny_mce.js',
theme : "advanced",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
content_css : "css/tinymce.css?" + new Date().getTime()
});
//render_my_jquery_ui_objects(); // if I call render_my_jquery_ui_objects() here, it will work fine. Both objects (button and tabs) will be rendered
});
</script>
</head>
<body onload=""> <!-- if I put render_my_jquery_ui_objects() in the onLoad event, it will also work fine -->
<button onclick="render_my_jquery_ui_objects();">Render my jQuery UI objects manually</button> <!-- if I click the button to call render_my_jquery_ui_objects(), only the jQuery button is rendered. The tabs are not rendered. This is my problem here. -->
<br/><br/>
<a href="#" id="my_button_1">Button 1 (jQuery)</a>
<br/><br/>
<div id="my_tabs">
<ul>
<li><a href="#tabs-1">My tab 1</a></li>
<li><a href="#tabs-2">My tab 2</a></li>
</ul>
<div id="tabs-1">
<p>Tab 1 content</p>
</div>
<div id="tabs-2">
<p>Tab 2 content</p>
</div>
</div>
<br/>
<textarea id="my_editor_1" name="my_editor_1" rows="10" cols="100" class="tinymce">
<b>text in bold</b><br>text normal
</textarea>
</body>
</html>