Click here to Skip to main content
15,892,161 members
Articles / Web Development / HTML

A Plugin for CKEditor With Dynamic Data

Rate me:
Please Sign up or sign in to vote.
4.50/5 (5 votes)
16 Dec 2010CPOL8 min read 48K   830   12  
With JavaScript and a bit of ASP.NET, it is possible to create a plugin for CKEditor that allows users to select from items drawn from a database.

function Init_CKEditor(ClientId) {
    // Perform the replace on the given client id
    var Editor = CKEDITOR.replace(ClientId);
    
    // Add a function used by our custom plugins
    Editor.loadXMLDoc = function(path) {
        var xhttp=new XMLHttpRequest();
        xhttp.open("GET", path, false);
        xhttp.send();
        return xhttp.responseXML;
    }
    
    // The data used by the plugins
    Editor.StaffData = '/DynamicXml.aspx'; 
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
Gregory Gadow recently graduated from Central Washington University with a B.S. that combined economics and statistical analysis, and currently works for the Washington Department of Fish & Wildlife as an IT developer. He has been writing code for 30 years in more than a dozen programming languages, including Visual Basic, VB.Net, C++, C#, ASP, HTML, XML, SQL, and R.

Comments and Discussions