Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Make a HtmlEditor: Why an IFrame and not a Div?

Posted on 2008-06-13
7
Medium Priority
?
244 Views
Last Modified: 2011-09-20
Why do they make HtmlEditors out of an IFrame? The tag was depricated in 97 and we have an Object tag.

Why not even make a div and just listen to gotfocus/lostfocus events to emulate a text area?

What functionality does an IFrame give us that is so valuable?
0
Comment
Question by:msmyers
[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
  • 3
  • 3
7 Comments
 

Author Comment

by:msmyers
ID: 21782511
Ok i found out that we can simply say iframe.execCommand(bold) and it will bold the selected text. But can't we get that functionality with controller.makeBold(controller.getSelectedText(div)) too?!

What is unique about an IFrame? Is this the only practical way to make an editor?
0
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 750 total points
ID: 21783216
msmyers,

The big reason is most likely compatibility.  Both across versions and between different browsers.  The iframe tag provides a nice option that is pretty equally supported.

To clarify one thing, to my knowledge the iframe tag has never officially been deprecated.  It was not included in XHTML specs and the object tag does seem to be the preferred method for the future but since it was never deprecated the support for iframe should remain for a while.  As long as loose DTD's are supported in specs that have iframe.  Until it is officially deprecated I would suggest it is pretty safe to use for its unique purposes.

Let me know if you have any questions or need more information.

b0lsc0tt
0
 
LVL 44

Expert Comment

by:scrathcyboy
ID: 21783808
AN iframe can do much more than you realize.  An iframe is a PAGE within a PAGE -- you can insert an entire google search page into an iframe.  It is very powerful, and if supposedly deprecated, well, that is a huge mistake.  There is no other easy way to embed a complete webpage into a page, like an iframe does.
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 Closing Comment

by:msmyers
ID: 31618585
Meh, its what i expected to be the reason, but I was looking for a real solid reason i hadn't thought of before.. But sometimes the simplest is the answer.
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 21783901
I don't use it much for embedding web pages but the method with the object tag is like the html below.  That exact html was tested and worked in Firefox.  The EE domain didn't work testing on my local web server with IE7 but change the URL to a file on the same domain/server and it worked in both.

I won't be surprised if there are limits to object working when iframe does so I still use it as the first option when I need it and the doctype will allow.  It is good to know there are options and the object tag can handle many different types of files (http://joliclic.free.fr/html/object-tag/en/).

bol
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link href="/style.css" rel="stylesheet" type="text/css" />
<title>HTML page in page w/ object</title>
</head>
 
<body>
<h3>Embedding an html page with object tag</h3>
 
 
<p>This is content from the main page.  See how bland it is.</p>
 
<br /><br />
<object data="http://www.experts-exchange.com/M_3599182.html" type="text/html" width="300" height="200">
  alt : <a href="http://www.experts-exchange.com/M_3599182.html">test</a>
</object>
 
</body>
</html>

Open in new window

0
 

Author Comment

by:msmyers
ID: 21783913
I appreciate the follow up.

0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 21783947
Actually I worked on it and posted it before I saw your close.  I am glad you appreciate it.

Re: Grading comment
Simple answers usually are best. :)

bol
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
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…

715 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