How to make links open in the sidebar

Use this only where appropriate please (like to show a list of links, etc. etc.) if you did this with all your links, it could get v. v. annoying. LOL!

It’s a very simple piece of code that does this:

<a href=”javascript:void(_search=open(’http://www.somesite.com/PAGE/YOU/WANT/TO/OPEN.htm‘,’_search’))”>

update: also, on the page you have opening in the sidebar… if you want links from that page to open in the main window, either add this inside the A tag:
target=”_main”
or add this insdie the head tags:
<base target=”_main”>

Please note this works for PC IE only.

8 Responses to “How to make links open in the sidebar”

  1. Mariann Says:

    Woo-hoo… it’s really that easy? Wonderful! Thanks. :)

  2. Christine Says:

    Is this the info to make the list open in the sidebar on IE? I’m … so confused. I think that’s what it is. Is it?

  3. M@ri@nn's Pl@ce Says:
    Sidebar Launch
    Woo-hoo… thanks to Jenn and Scripty Goddess, I now have a launchable sidebar of blogging links on my test PHP

  4. Mariann Says:

    I added the sidebar with the target code in the sidebar page’s header, but my links are opening up in the search bar! Should the code be in the main page instead?

  5. Jennifer Says:

    Christine - yes. That is what you do to your link to get that link to open up in the side bar. (PC IE only)

    Mariann - not sure what you’re doing… so here’s a little sample:
    <html>
    <head>
    <title>YOUR TITLE HERE</title>
    <base target=”_main”>
    </head>
    <body>
    YOUR PAGE STUFF HERE. Any links will automatically open up in the main window so all you have to do is this <a href=”http://www.website.com”>link</a>
    </body>
    </html>

  6. julie Says:

    would the link have no response if someone were to click on it using a mac or a browser other than IE?

    i know i’m a month behind the times but i hope it’s not too late to get a response.

  7. Getsutora Says:

    This link would not have any effect in, say, Mozilla Firefox. However, all of the links in a sidebar page for IE maide like this will open correctly in Mozilla.

    To add a sidebar page in Mozilla Firfox, add it to your favorites, and then make sure you check the box to say to open the link in the sidebar.

  8. dalibor Says:

    Yes, TARGET=_main works for links, but I would like to know is there a way to get a handle of _main window via JavaScript. I would like to display main URL, something like:

    alert(”Your URL is” + _main.location.href)

    Is there a way to do this via JS?