Results 1 to 3 of 3

Thread: Equivalent of queryCommandValue("FontName") in Mozilla

  1. #1
    Join Date
    Dec 2008
    Location
    Nigeria
    Posts
    95
    Thanks
    3
    Thanked 8 Times in 8 Posts

    Default Equivalent of queryCommandValue("FontName") in Mozilla

    Hi, i am workin on a project requiring me to create a very small but crossplatform rich text editor - i hav completed it - crossplatform,
    but i do not seem to know the equivalent of queryCommandValue in mozilla.
    Any help will be greatly appreciated. The method works in new mozilla but i am not sure if it works in the old ones.
    Last edited by diltony; 01-25-2009 at 11:50 AM.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Please post a link to the page on your site that contains the problematic script so we can check it out.

    Please include your code so that we can take a look at it, we can't do much without it.

    Please do the above so we can help with your request.
    Jeremy | jfein.net

  3. #3
    Join Date
    Dec 2008
    Location
    Nigeria
    Posts
    95
    Thanks
    3
    Thanked 8 Times in 8 Posts

    Default

    Code:
    <script>
    function loadRTF(rteName,rtePreloadContent,rteCSS) {
        with(document.getElementById(rteName).contentWindow.document) {
        open(); 
        write("<html><head><style type=\"text/css\">@import url("+rteCSS+");</style></head><body>" + rtePreloadContent + "</body></html>"); 
        close();     
        designMode = "on";
        setInterval(function() {
            try {document.title=queryCommandValue("FontName");} catch(err) {void(0);}
                    },1000);
        }
    }
    </script>
    
    <iframe id="rtf" name="rtf"></iframe>
    This aspect works but i suspect some old browsers especially mozilla may not know what queryCommandValue means - there is an alternative method which i seem to have forgotten.
    What i was tryin to do is to track the font properties of whatever selection is made in the rich text.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •