Controversial Web "Framing" Makes a Comeback 210
theodp writes "The WSJ reports that the controversial practice of framing seems to be making a comeback on the Web. Big sites like Digg, Facebook, Ask.com and StumbleUpon have all begun framing links recently, joining the likes of Google, which employs the technique for Image Search. Long ago, Jakob Nielsen argued that 'frames break the fundamental user model of the web page,' but, today's practitioners contend, 'it's a feature, not a bug,' and say it provides publishers with massive distribution they wouldn't otherwise have."
How to stop it (Score:5, Informative)
<script type="text/javascript"><!--
var _tl=top.location,_sl=self.location;if(_tl!=_sl)window.top.location=_sl;
//-->
</script>
The i's have it (Score:3, Informative)
I assume we are talking about i-frames here, not setting out an entire page using the old-fashioned Frameset method. Frameset layouts were a nightmare in many ways and their passing is a good thing, but using an i-frame to show some or all of a separate webpage on the page you are viewing can be very useful, and is perfectly kosher in terms of valid HTML and CSS as far as I know.
Re:The i's have it (Score:3, Informative)
<iframe id="diggiFrame" name="diggiFrame" noresize="noresize" src="http://www.linuxjournal.com/content/internet-censorship-us-or-just-law-enforcement" frameborder="0"></iframe>
It does seem to be easy to 'permanently' remove, but I'm not a 'fan' of wrapped content of any form.
Re:Can I close the frame? (Score:5, Informative)
Not that this affects you point, but for sites that don't offer that (I haven't come across any),
In firefox: right click -> this frame -> show only this frame, will sort you out, other browsers probably perform similarly.
What is the alternative? (Score:4, Informative)
Frames made it very simple to have you web content broken up into nice blocks. You could do all your navigation in one frame, that meant, one file contained your menus. You had one file to edit and you could produce a well defined, well behaved navigation system.
With the jihad against frames we were left with two options:
ALL of this could have been solved by having the HTML spec provide a #include tag that would tell the browser to fetch that file eg: but no one seems to like that idea anymore then they likes framsets or iframes
As to Jakob Nielsen saying it breaks the user interface, that guy needs to get over himself in a big way. The web is evolving and changing all the time. As so many have said, the browser is not simply a page reproducer any more, those days are long gone, it has become an application container that allows applications, served from without to run in a defined and "secure" ( we hope ) application space on the local machine.
I for one advocate forking the whole notion. It is time to create and application shell that is specifically designed do just run applications of some specification. I propose that this can be done by making a tag to go along side as the top level tag and call . This would allow the "browser" to take one of two immediate actions:
Further I propose that the navigation portion of be ported out to the browser and you simply load the elements of the menus and it is fed by a separate channel much like XMLhttprequest.
Re:The i's have it (Score:2, Informative)
No, the iframe element is not a valid element in HTML 4.01 Strict.
Re:What is the alternative? (Score:3, Informative)
Re:Can I close the frame? (Score:3, Informative)
No, because of same-origin security - $EVIL_SITE's JavaScript can't read the location of the bottom frame.
Re:What is the alternative? (Score:2, Informative)
<?php
include('menu-filename');
?>
(For those of you new to PHP, everything in the file not enclosed in a tag is just HTML, so you don't need to know much to add a little PHP into an HTML file. On the other hand, your hosting service has to support PHP for this to work.)
You can also turn it inside out and put the menu into your main page file (which has to be PHP), and have each menu item link to the main page with a parameter added to the URL identifying the page to be displayed -- default to 'home'. You set up the menu, then drop the page content into the page at the appropriate point. You only update the menu (and overall layout) in one place, and it instantly applies to all your content pages.
That would take a couple of evenings reading up on PHP, if it's new to you. Especially read up on security -- for example, DO NOT put the actual name of the file in the URL, use an index to an internal table of valid file names. You (probably) wouldn't want to let users start displaying any file on your computer whose name they typed appended to the URL.
I guess it's a very poor man's CMS.