Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/374.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在两个应用程序中使用时,未在IE中加载ckeditor_Javascript_Internet Explorer_Ckeditor - Fatal编程技术网

Javascript 在两个应用程序中使用时,未在IE中加载ckeditor

Javascript 在两个应用程序中使用时,未在IE中加载ckeditor,javascript,internet-explorer,ckeditor,Javascript,Internet Explorer,Ckeditor,我有一个存储ckeditor的中心位置 Header web应用程序在IE、Firefox和Chrome中成功地使用了ckeditor 始终为域中的所有web应用程序加载标头 Web应用程序X需要一个编辑器。Web应用程序等待(使用超时)CKEDITOR对象可用,然后使用它 这适用于Chrome和Firefox,但不适用于IE。我在这里遗漏了什么 IE中的超时仍在继续,但CKEDITOR对象永远不可用 代码: Html: “src”不可用。是否是防疼痛设置导致IE加载出现问题 加载期间出现错误消

我有一个存储ckeditor的中心位置

Header web应用程序在IE、Firefox和Chrome中成功地使用了ckeditor

始终为域中的所有web应用程序加载标头

Web应用程序X需要一个编辑器。Web应用程序等待(使用超时)CKEDITOR对象可用,然后使用它

这适用于Chrome和Firefox,但不适用于IE。我在这里遗漏了什么

IE中的超时仍在继续,但CKEDITOR对象永远不可用

代码:

Html:

“src”不可用。是否是防疼痛设置导致IE加载出现问题

加载期间出现错误消息:


“错误:无效参数。\n在匿名函数()\n在匿名函数()\n在匿名函数()\n在全局代码()”

我可以通过检查应用程序中加载的所有脚本来解决此问题。其中一个脚本加载出现问题,阻碍了IE上ckeditor的加载。

您也可以通过更改应用程序中脚本的顺序来解决此问题。

请提供您正在使用的HTML,如果可能,请提供演示此问题的工作提琴。
namespace Models
{
    using System.ComponentModel.DataAnnotations;

    public class EmailModel
    {
        public int EmailID { get; set; }
        public string FromAddress { get; set; }
        public string ToAddresses { get; set; }

        [Required(ErrorMessage = "Subject is required.")]
        [StringLength(50, ErrorMessage = "Subject cannot be greater than 50 characters.")]
        public string Subject { get; set; }

        [Required(ErrorMessage = "Body is required.")]
        public string Body { get; set; }
    }
}
@model Models.EmailModel

@{
    ViewBag.Title = "Email Template Details";
}

<h2>Email Template Details</h2>

<script type="text/javascript" src="~/Scripts/EmailDetails.js?version=06.07.2016_1156"></script>

<div>
    <hr />
    <dl class="dl-horizontal">
        <dt>
            @Html.DisplayNameFor(model => model.FromAddress)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.FromAddress)
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.Subject)
        </dt>

        <dd>
            @Html.DisplayFor(model => model.Subject)
        </dd>

        <dt>
            @Html.DisplayNameFor(model => model.Body)
        </dt>

        <dd>
            @Html.HiddenFor(model => model.Body)
            <textarea id="editorBodyDetails" name="editorBodyDetails" style="display:none"></textarea>
        </dd>

    </dl>
</div>
<p>
    @Html.ActionLink("Edit", "Edit", new { id = Model.EmailID }) |
    @Html.ActionLink("Email Templates", "Index")
</p>
var countCKEDITORAttemps = 0;

$(function () {

    initializeCKEDITOROnceLoaded(countCKEDITORAttemps);

});

function initializeCKEDITOROnceLoaded(countCKEDITORAttemps) {
    var interval = 1000; // ms
    if (countCKEDITORAttemps < 100) {
        window.setTimeout(function () {
            if (typeof(CKEDITOR) !== 'undefined') {
                setupCKEditor("editorBodyEdit");
            } else {
                countCKEDITORAttemps = countCKEDITORAttemps + 1;
                console.log("Loading CKEDITOR:" + countCKEDITORAttemps * 1000 + "milliseconds");
                window.setTimeout(initializeCKEDITOROnceLoaded(countCKEDITORAttemps), interval);
            }
        }, interval);
    }
}

function setupCKEditor(id) {
    CKEDITOR.replace(id, { height: 200, });
    CKEDITOR.instances[id].setData($("#Body").val());
}
var b=d[c].src.match(a);