IE WYSIWYG editing... problems

T

teknodude

Guest
I have developed a WYSIWYG editor that will only work in IE, due to it's use of IE's proprietary features (e.g. document.designMode and document.execCommand('bold', false, null)). Now, it works fine in IE6 on the PC (and should in theory work no problem on IE5), but when opened in IE5 on a Mac it doesn't work :-S

Does anyone know why this is? Does IE on the Mac not support the WYSIWYG editing that IE on the PC allows you to achieve through IE's proprietary scripting?

TIA for your help folks :)

teknodude
 
Joined
Feb 25, 2003
Messages
5,279
Reaction score
138
Points
63
Location
Tropical Island, Jealous?
Your Mac's Specs
MacPro 3.0Ghz 16GB RAM, 4x256 Vid, 30''cinema display
Hmm, your going to have to give us more information about the codeing of the program... because mac is different from Windows.. and OSX is even more different (PC hasnt had time to copy mac well enuf yet, like they did with classic)
 
OP
T

teknodude

Guest
Huh ... well I don't want a PC vs Mac rant, lol :)

But here's the code that's not working on IE on the Mac...

<a href="javascript: format_bold();" onfocus="this.blur()" onmouseover="window.status='bold'; return true;" onmouseout="window.status=''; return true;"><img src="../../images/icons/icon_bold.gif" width="23" height="22" vspace="5" alt="bold" border="0"></a><br>
<iframe name="f_intro_content" marginheight="0" marginwidth="0" frameborder="0" style="border: 1px solid #C0C0C0; width: 450px; height: 150px"></iframe>
<script language="JavaScript">
var edit_frame = document.f_intro_content;

<?php
for($x = 0; $x < @count($existing_intro_content_source); $x++){
?>
edit_frame.document.write("<?= @addslashes(@trim($existing_intro_content_source[$x])) ?>");
<?php
}
?>

function init(){
edit_frame.document.designMode = 'On';
}

function format_bold(){
edit_frame.document.execCommand('bold', false, null);
}

function get_source(){
document.f_intro_content_source.f_source.value = edit_frame.document.body.innerHTML;
}

init();
</script>

The code basically writes the existing content to the IFRAME and then makes the IFRAME editable. The user should then be able to edit the text in the IFRAME and format, in this example they should be able to select text and make it bold.

Thanks for your help,

teknodude
 
Joined
Feb 25, 2003
Messages
5,279
Reaction score
138
Points
63
Location
Tropical Island, Jealous?
Your Mac's Specs
MacPro 3.0Ghz 16GB RAM, 4x256 Vid, 30''cinema display
Im pretty shur that code will not work for mac.. because frame.document.exec.. wont be read the same.. i theory it should work, but i dont think it will.
 
Joined
Jan 15, 2003
Messages
4
Reaction score
16
Points
3
Location
Whangarei, New Zealand
Your Mac's Specs
Pwnt
So its not a WYSIWYG problem, its just differences in coding support between browsers? I agree with graphite.
 
OP
T

teknodude

Guest
So... IE on Mac does not support the MSHTML scripting features that I'm using, correct? Is there any way around this?

Thanks for your help so far,

teknodude
 
Joined
Feb 25, 2003
Messages
5,279
Reaction score
138
Points
63
Location
Tropical Island, Jealous?
Your Mac's Specs
MacPro 3.0Ghz 16GB RAM, 4x256 Vid, 30''cinema display
I really dont know what IE for mac supports.. I would not be surprised if IE just slapped it together and skipped out alot. There are sites which require a PC with IE to view them.. (course there are ways around it like OmniWeb, but they never turn out rite) So I would believe it to be true that IE for mac does not support MSHTML.. I could still be wrong about all this and you may just be missing a lead in or somthing, or a minor lead in variable..
 
OP
T

teknodude

Guest
Graphite said:
I really dont know what IE for mac supports.. I would not be surprised if IE just slapped it together and skipped out alot. There are sites which require a PC with IE to view them.. (course there are ways around it like OmniWeb, but they never turn out rite) So I would believe it to be true that IE for mac does not support MSHTML.. I could still be wrong about all this and you may just be missing a lead in or somthing, or a minor lead in variable..

Ok... so I think we've established that when it comes to IE on the Mac, the MSHTML component is screwed. Any ideas on alternatives folks? My client really needs this WYSIWYG feature and I need to be able to customise as he won't require all WYSIWYG controls (i.e. bold, italic, underline, colour) on every WYSIWYG feature.

teknodude
 
Joined
Jan 15, 2003
Messages
4
Reaction score
16
Points
3
Location
Whangarei, New Zealand
Your Mac's Specs
Pwnt
Can you do it through a form, and have the browser display the preview up the top and an option to edit it underneath that? That shouldn't be too hard with a little bit of php or perl. It would be more cumbersome than what you want to do at the moment (if I'm grasping the concept correctly), but should work on all browsers.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top