?
Solved

execCommand.

Posted on 2003-02-26
8
Medium Priority
?
543 Views
Last Modified: 2008-02-01
Hi all,

I have tried out a code i read from www.devarticles.com using execCommand to enable users to bold a certain text.

A part of it is :

function Init()
{
iView.document.designMode='On';
}

and my body is <body onLoad="Init()">

However, previewing in IE5, there is an error in the body tag.

Im not able to type in the iframe also (even though the designMode is set to 'On'

Is there something that I miss here?

Hope someone can help me.
Thank you very much.
0
Comment
Question by:megmeg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 14

Assisted Solution

by:avner
avner earned 75 total points
ID: 8025106
What is iView ?
You'll have to post more code...
0
 
LVL 1

Accepted Solution

by:
mbochniak earned 75 total points
ID: 8026372
If iView is the id (id="iView") of the iFrame, then you have the syntax backwards. It should be:

document.iVeiw.designMode='on';

The uppercase in 'On' may also be a problem. I'm not sure, though.
0
 

Author Comment

by:megmeg
ID: 8030294
Avber,ivView is the id for my iFrame.

This is the body ( which has error in the <body onLoad="Init()"> )

<body onLoad="Init()">
<iframe id="iView" width="200" height="70"></iframe>
<br><br>

<input type="button" onClick="boldIt()" value="Toggle Bold">
</body>

This is the js function.

<script language=\"JavaScript\">

function Init()
{
iView.document.designMode="On";
}

function boldIt()
{
iView.document.execCommand("bold", "false", "null");
}

</script>

mbochniak, I have tried to change the uppercase to lowercase but its still not working. I think the syntax is correct isnit?

Thank you..

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:megmeg
ID: 8030482
hi..

i have solved the problem i guess. It was all my stupidness. After posting the previous comment, I found my error in <script language=\"JavaScript\"> . I shouldnt put a \ in the script.

I was doing some work in php, thats why i had put the \ before it. Once take out, it works.

I think conclusion would be take, the upper and lowercase works fine. and the syntax is ok.

Thanks for the two of you in replying to me.
0
 

Author Comment

by:megmeg
ID: 8030553
hi..

i have solved the problem i guess. It was all my stupidness. After posting the previous comment, I found my error in <script language=\"JavaScript\"> . I shouldnt put a \ in the script.

I was doing some work in php, thats why i had put the \ before it. Once take out, it works.

I think conclusion would be take, the upper and lowercase works fine. and the syntax is ok.

Thanks for the two of you in replying to me.
0
 

Author Comment

by:megmeg
ID: 8031008
hi..

i have solved the problem i guess. It was all my stupidness. After posting the previous comment, I found my error in <script language=\"JavaScript\"> . I shouldnt put a \ in the script.

I was doing some work in php, thats why i had put the \ before it. Once take out, it works.

I think conclusion would be take, the upper and lowercase works fine. and the syntax is ok.

Thanks for the two of you in replying to me.
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 10095865
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

PAQ with points refunded

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jAy
EE Cleanup Volunteer
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question