Edw*_*ard 1 jquery tinymce path relative-path twitter-bootstrap
我在 Q/A 应用程序中使用 TinyMCE 和 Twitter Bootstrap v3.1。
出于某种原因,我在控制台中从 TinyMCE 收到多个 404 错误:
GET http://localhost/assets/lib/TinyMCE/themes/modern/themeundefined.js 404 (Not Found) tinymce.min.js:3
Failed to load: /assets/lib/TinyMCE//themes/modern/themeundefined.js
Run Code Online (Sandbox Code Playgroud)
据我所知,路径是正确的。我已经将路径直接输入到浏览器栏中(没有 undefinedtheme.js),它会弹出。
TinyMCE 的完整路径是: http://localhost/application/assets/lib/TinyMCE/
tinyMCE.baseURL = "/assets/lib/TinyMCE";tinyMCE.baseURL = "/application/assets/lib/TinyMCE";tinyMCE.baseURL = "localhost/application/assets/lib/TinyMCE";我已经在 TinyMCE 常见问题解答中搜索了将我指向 mod_rewrite 的问题。
基本上是什么原因造成的undefinedtheme.js?
我的 TinyMCE 发起者:
//TinyMCE Initiator
//set scope
$(document).ready(function() {
tinyMCE.baseURL = "/assets/lib/TinyMCE";
tinymce.init({
selector: "textarea#tinymce",
theme: "modern",
/*width: 400,*/
height: 300,
plugins: [
"advlist autolink link lists charmap print preview hr anchor pagebreak spellchecker",
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime nonbreaking",
"save contextmenu directionality emoticons template paste textcolor"
],
content_css: "../assets/css/bootstrap.css",
toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify bullist numlist forecolor | outdent indent | l ink | ",
style_formats: [
{title: 'Bold text', inline: 'b'},
{title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
{title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
{title: 'Example 1', inline: 'span', classes: 'example1'},
{title: 'Example 2', inline: 'span', classes: 'example2'},
{title: 'Table styles'},
{title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
]
});
});
Run Code Online (Sandbox Code Playgroud)
TinyMCE 应该包含在 textarea 标签之前,而不是之后
<doctype html>
<head>
<script src="/assets/lib/TinyMCE/tinymce.min.js"></script>
</head>
<body>
<div class="container" role="main">
<textarea id="tinymce"></textarea>
</div>
</body>
<script>
$(document).ready(function() {
tinymce.init({
selector: "textarea#tinymce",
theme: "modern",
//width: 400,
height: 300,
plugins: [
"advlist autolink link lists charmap print preview hr anchor pagebreak spellchecker",
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime nonbreaking",
"save contextmenu directionality emoticons template paste textcolor"
],
content_css: "../assets/css/bootstrap.css",
toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify bullist numlist forecolor | outdent indent | l ink | ",
style_formats: [
{title: 'Bold text', inline: 'b'},
{title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
{title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
{title: 'Example 1', inline: 'span', classes: 'example1'},
{title: 'Example 2', inline: 'span', classes: 'example2'},
{title: 'Table styles'},
{title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
]
});
});
</script>
</html>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2448 次 |
| 最近记录: |