View Full Version : Resolved Equivalent of queryCommandValue("FontName") in Mozilla
diltony
01-24-2009, 10:19 PM
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.
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.
diltony
01-25-2009, 07:57 AM
<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.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.