Drawing Hands by M.C. Escher (1948)

Jeff Mesnil


A bookmarklet to split HTML document within the browser

On July 16th, 2004 in javascript, web

[update: the bookmarklets were broken for a long time but they now work again on Firefox 3 and Safari 3]

In a comment on his blog, I proposed to Cedric a simple solution to spilt a HTML page in two within the browser. It’s just a one line JavaScript but it can be handy to use it,

split document in new window -> drag to your bookmark folder

When you want to split a html document, click on the bookmark and you’re done (it works on Safari and Firefox)

Cedric then suggested to split the document in the current window. So here come two new bookmarklets:

13 Responses to “A bookmarklet to split HTML document within the browser”

  1. Jonathan Says:

    I’m impressed! I’m going to add it to my Firefox Sidebar! (http://www.geocities.com/jonathan_aquino/bookmarks.html)

  2. Anonymous Says:

    Amazing work! Thanks.

    - Chu Yeow

  3. Anonymous Says:

    Very useful feature.

    The only gripe I have is it seems to cause double scrollbars (in frame and in firefox). Maybe setting height as 99% or something like that would fix it.

    Pete

  4. sb Says:

    This is amazing! — I’ve wanted something like this for a long time, but not being a techie didn’t realize it was even possible.

    Next time I’ll ask.

    Thank you thank you thank you!

  5. __sdfg Says:

    Awesome.

  6. Anonymous Says:

    Extremely cool. Thanks!

  7. Anonymous Says:

    Incredible. Works here at my Dad’s in Netscape 7. Can’t wait to get home and put it on my machine. Thanks

  8. Anonymous Says:

    It doesn’t work in IE and unfortunately some of us have to follow corporate standards. At home of course I’ll be fine :-)

  9. Anonymous Says:

    Adding

    {var u=location.href;

    before the document.write, and the following after the document.write

    window(’Frame1′).location.href=u;
    window(’Frame2′).location.href=u;}

    plus the appropriate Name attributes to the Frame elements created by the document.write, makes this bookmarklet work for me in IE.

    Sorry, for the description, but Blooger wouldn’t allow me to post the actual code or a link in this comment.

  10. Anonymous Says:

    With a slight extension, this bookmarklet becomes even more useful for me; this only works in Firefox and Mozilla:
    Change the current URL as follows:
    - instead of the second location.href use ‘%s’ (you must type in the quotes as well!)
    - Append “;document.close()” (without the quotes) to make the load progress indicator stop in Firefox.

    Once you’ve created the bookmark, you must give it a keyword, for example “split”. Then, if you have a new URL whose page you want to compare with the current one, side by side, you enter in the address field:
    “split new.url.com”.

    Here is more info on the custom mozilla keywords:
    http://www.mozilla.org/docs/end-user/keywords.html

  11. jmesnil Says:

    thanks for all the feedback. I’ve updated the bookmarklets to fix minor bugs and make them work on IE6. they’re available at this URL.

  12. notpeter Says:

    Doesn’t work with Opera9 win32. :(

  13. Jeff Mesnil » Blog Archive » Updated split bookmarklets Says:

    [...] its presentation it (in a minimalist but not so minimalist fashion) when I saw that my popular split bookmarklets were broken due to a bad [...]