我的 home.js 文件中写了以下内容:
define(['services/logger'], function (logger) {
var vm = {
activate: activate,
title: 'Home View'
};
return vm;
//#region Internal Methods
function activate() {
logger.log('Home View Activated', null, 'home', true);
return true;
}
//#endregion
var editor, html = '';
function createEditor() {
if (editor)
return;
// Create a new editor inside the <div id="editor">, setting its value to html
var config = {};
editor = CKEDITOR.appendTo('editor', config, html);
}
function removeEditor() {
if (!editor)
return;
// Retrieve the editor contents. In an Ajax application, this data would be
// sent to the server or used in any other way.
document.getElementById('editorcontents').innerHTML = html = editor.getData();
document.getElementById('contents').style.display = '';
// Destroy the editor.
editor.destroy();
editor = null;
}
function MultiSelect() {
("#Sites").multiselect();
}
});
我的 home.html 文件包含以下内容:
<section>
<h2 class="page-title" data-bind="text: title"></h2>
</section>
<section id ="Recipients">
<article>
<div class="row">
<div class="span6">
<label for="Study">Study: </label>
<ul class="dropdown-menu" id="Study"></ul><br />
<label for="Sites">Sites: </label>
<ul class="dropdown-menu" data-bind="text: Sites" title="Sites" id="Sites" ></ul><br />
<label for="Distribution">Distribution: </label>
<input type="checkbox" data-bind="text: Distribution" title="Distribution" />
</div><!-- span6 -->
</div><!-- row -->
<div class="row">
<div class="span6">
<label for="Recipients">Recipients: </label>
<input type="checkbox" data-bind="text: Recipients" title="Recipients"/><br />
</div><!-- span8 -->
</div><!-- row -->
</article>
</section>
<section id ="Communication">
<article>
<label for="SendFrom">Send From: </label>
<label id="SendFrom"></label><br />
<label for="Subject">Subject: </label>
<input id="Subject" /><br />
<div id="editor">
</div>
</article>
</section>
Bootstrap 类没有呈现我指定的布局。此外,JQuery 多选和 ckEditor 也没有呈现。我已经仔细检查了解决方案文件是否包含 jquery、bootstrap 等。我还需要更改哪些其他内容以确保正确呈现 javascript?