![]() Topic awaiting preservation: Super-simple textarea tag-o-matic: cross-browser? (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: Milwaukee |
![]() So I've got reason to make a really simple "select some text, click a link, tags appear" device for a website. Nothing fancy, just bold, italic, URL -- the usual. And I've adapted some code to do what I want, and life is fine, almost; but this code only seems to work in IE, not Opera 7 or Mozilla. It's not a major issue, since my client probably wouldn't even think of testing it in a non-IE browser (he refers to the site as 'his web,' and he keeps forgetting his browser has a Back button), but my personal pride makes me want to get it working cross-browser. code: function addFormatTags(tag)
code: <a href="javascript:addFormatTags('strong')" title="make selected text bold">Bold</a>
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
![]() Unfortunately I don't think the "createRange" bit is supported |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
![]() I think createRange *is* supported, but differently - specifically, you can't use document.selection to get the selection range. Check out |
Paranoid (IV) Inmate From: Milwaukee |
![]() I'm having a really hard time with this, since standards-compliant DOM-based Javascript seems to be little-discussed... the only things I've been finding are W3 recommendations, which are a bit too cryptic for me, and platform-specific stuff from the late 90s. code: range = Document.createRange();
|