473,396 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Using execCommand to edit an existing HTML page

Hi,

I have made a basic WYSIWYG editor using the execCommand functions. I
use an iFrame as the editing area and so far I have managed to create
documents from a blank page and save them to a database.

What I am having problems doing is editing an existing HTML document.
Until now I have used a button with onclick element as follows to
populate the iFrame with the current HTML:

onclick="iEditor.document.body.innerHTML = '<font color=#000066>This is
a test page';"

[where iEditor is the iFrame]

The hassle of having to click a button to populate the editor is
annoying, so I have tried to run this command at the <body onload="...
stage however I get an error saying the object iView.document.body is
non-existant.

Can anyone offer any advice (or links to any advice) regarding this
'problem'?

Thanks for your help!

Regards
Edd

--
Edd Read
mail@eddreadREMOVE_ME.co.uk
www.eddread.co.uk
+44 (0)7929 130229
Jul 20 '05 #1
1 2035
Ivo
Doesn't sound like the execCommand is causing the problem. Are you not
confusing the documents in different frames? One does not
automatically know when the other has loaded. If it hasn't, especially
when the <body> opening tag has not yet been written, there may be the
answer why iView.document.body is non-existant.
Perhaps post a bit more code, so we know what iEditor and iView are.
Iv
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Sharon | last post by:
Hi! I need help. I have a variable which is just a string containing the output of a transform from XML to CSV format. I want the client to be able to download this as a file (.csv), so I used...
1
by: anonieko | last post by:
> Use x = window.Open(...) x.document.write( yourhtml) > How to print from javascript using .print > How to use ContentWindow > > How t use getElementById > How to get HTML of document...
4
by: am75 | last post by:
Hi everybody, I'm developing web pages for content management using iframes, through which users can edit html portions... I found execCommand to apply simple formats (bold, italic...) to text....
1
by: J. Shane Kunkle | last post by:
A customer would like to redirect visitors to a "goodbye" page when they click on an outside link on their website. The website is quite large and I would rather not wade thru all the existing...
23
by: abdalimohd | last post by:
hi all, i m developing an html editor for my web page since i cannot trace out the enter key press for the available html editors for asp.net app. now i have done everything that i need with this...
5
theGeek
by: theGeek | last post by:
Hi All, I want to save the current page using javascript(in asp.net). Though I could find out that the "execCommand" can do that but the only options for file types that are available in the save...
1
by: sourcie | last post by:
I am changing an existing quiz found on "JavaScriptKit.com Multiple Choice Quiz" I have an image. Instead of using the radio buttons with the normal true/false question, I want to place two...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.