Forum Moderators: open

Message Too Old, No Replies

Javascript not working on Mac Browser

         

TheFlyboy

10:28 pm on Nov 1, 2004 (gmt 0)

10+ Year Member



<script language="javascript" type="text/javascript">
<!--
var editor = document.getElementById('radEditorContainerPassageEdit_txtPassageW_txtHTMLEdit');

function pasteTextInEditor(text)
{
//paste text in the active selection, that is - at the editor's cursor position

editor.focus();
var range = document.selection.createRange();
range.pasteHTML(text);
return false;
}

Can someone tell me what is wrong with this query, I can try the same above but with

editor.innerHTML = "";

and that doesn't work either, am I getting the client ID wrong?

Please advise.

dcrombie

10:36 am on Nov 2, 2004 (gmt 0)



I think that code will only work in MSIE(Win)

TheFlyboy

4:24 pm on Nov 2, 2004 (gmt 0)

10+ Year Member



Ok, what I am trying to accomplish is:

I want to use javascript to copy text from one div to another div. the innerHTML does not appear to work in the mac environment.

Does anyone know how to accomplish this?

Thanks in advance.

BjarneDM

10:12 pm on Nov 2, 2004 (gmt 0)

10+ Year Member



InnerHTML should work in all Mac Browsers.
That's the one non-w3c DOM-standard thing that every browser has implemented.
[mozilla.org...]

Otherwise, the way to go is through the w3c DOM model using cloneNode and replaceChild. See these references for the general idea:
[mozilla.org...]
[mozilla.org...]
[mozilla.org...]

also:
[developer.apple.com...]
[developer.apple.com...]

Macguru

9:33 pm on Nov 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thread moved to the Javascript forum from the Macintosh webmaster forum for better audience.