Opened 12 years ago

Last modified 12 years ago

#9163 closed Bug

IE8 & IE 7: not getting CKEditor.instances in IE8 and below version of IE — at Version 2

Reported by: Amit.Mukherjee Owned by:
Priority: Normal Milestone:
Component: General Version: 3.6.2
Keywords: Cc: deepak.bakshani@…

Description (last modified by Jakub Ś)

I am trying to attach the change , focus and blur events to my CKEditor instances that are dynamically generated.Find below the code. Its working fine for Ie9 and other browsers but not getting the instances in IE8 and below IE versions. Here is the code.

<script type="text/javascript">
        if (window.addEventListener) {

            window.addEventListener('load', onpageload, false);

        }
        else {

            window.attachEvent('onload', onpageload);
        }
    </script>

and the function is :

function onpageload(e) {
    var dirtyField = document.getElementById("dirtyfield");
    for (var i in CKEDITOR.instances) {
        CKEDITOR.instances[i].on('change', function () { dirtyField.value = true; });
        CKEDITOR.instances[i].on('focus', function () {
            this.document.$.childNodes[1].childNodes[1].style.backgroundColor = '#ebf5d0';
        });
        CKEDITOR.instances[i].on('blur', function () {
            this.document.$.childNodes[1].childNodes[1].style.backgroundColor = '#FFFFFF';
        });
    }
}   

Unable to get the instances in IE8 so the code in not able to loop and attach the events with the instances.

Change History (3)

comment:1 Changed 12 years ago by Amit.Mukherjee

Keywords: IE 8 CKEditor.instances added

comment:2 Changed 12 years ago by Jakub Ś

Description: modified (diff)
Keywords: IE 8 CKEditor.instances removed

Changed 12 years ago by Jakub Ś

Attachment: replacebycode2.html added
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy