Chat on IRC |
Editing HTML with Mozilla javascript
Posted by AnyoneEB [send private reply] at January 25, 2003, 06:45:51 AM
Is there some way to use javascript to insert HTML into the middle of a document. Specially, I want to make a Mozilla menu command that will comment out a selection.
Posted by regretfuldaydreamer [send private reply] at January 25, 2003, 08:07:41 AM
You mean once the file is loaded and rendered? I don't think so. I think you'd need to be using either DHTML(preferable - CSS+JavaScript) here or load a different page(not preferable)
Posted by Psion [send private reply] at January 25, 2003, 09:34:34 AM
"Commenting out a section" should be easy, I'm guessing: just include that section in a named <span> and delete it referenced by the name of that span.
Posted by regretfuldaydreamer [send private reply] at January 25, 2003, 09:41:14 AM
But then wouldn't the page have to be reloaded?
Posted by taubz [send private reply] at January 25, 2003, 10:10:43 AM
No, that's the point of JavaScript. You can also just change the visibility style of a div/span tag to hide it.
Posted by regretfuldaydreamer [send private reply] at January 25, 2003, 10:41:13 AM
Oh
Register as a new user | ||||||||