Re: rich text editing
- From: mel <samuelgoto@xxxxxxxxx>
- Date: Thu, 23 Aug 2007 16:16:33 -0700
great !! it works thanks !!!! I think I was doing almost the same, i
think the difference is that i was using iframe.src = "newlocation"
and you are using the setAttribute method =)
thanks !!!
BTW, is it possible to have an empty iframe (withou any src property)
and change its contents with innerHTML or something ?
On Aug 23, 4:21 pm, elephant <matt.mi...@xxxxxxxxx> wrote:
why does this works ...
I'm not positive why the second doesn't work, but, I think it's
because design mode needs to be run after the area loads
PS in case you are wondering, it is important for me to change
dinamically the src field of the iframe ... btw, is this possible ?
Yep, here you go
<script type='text/javascript'>
function changeSrc(newUrl) {
document.getElementById('myframe').setAttribute('src',
newUrl);
}
function designModeOn(sentIframe) {
sentIframe.contentDocument.designMode = "On";
}
</script>
<body>
<iframe id='myframe' src='deleteMe.html'
onload='designModeOn(this)'></iframe>
<button onclick='changeSrc("test.html");' />
</body>
Customize to fit your needs,
.
- Follow-Ups:
- Re: rich text editing
- From: elephant
- Re: rich text editing
- References:
- rich text editing
- From: mel
- Re: rich text editing
- From: elephant
- rich text editing
- Prev by Date: FAQ Topic - How do I trim whitespace - LTRIM/RTRIM/TRIM?
- Next by Date: Form with two buttons that submit to different pages
- Previous by thread: Re: rich text editing
- Next by thread: Re: rich text editing
- Index(es):
Relevant Pages
|