1

i need links in a profile-tab app i'm writing open in new browser tabs. i set target="_blank" (with both hardcoded and with FBJS), but when i click on the links, the app page just reloads. i had a look at the html of the app as it's rendered by FB, and each of my links has an onclik event on it, that after creating a new image, returns false. i tried doing linkDomObjectHandle.purgeEventListeners('click'), but as i expected, that didn't do much. does anyone know of a way to get this to work?

edit: tested, and "right-click -> open in new tab" and middle-click both do what is expected. just the left click event gets hijacked.

edit: some code snippets:
i have a template that is cloned, filled and the clone is appended to an element. here is the html of the template:

<div id="hover_window">
<a href="">
    <img src="">
    <div class="article_info">
        <div class="client_info"></div>
        <div class="media_info"></div>
    </div>
</a>
</div>

i fill the link by doing:

    var hover_window = document.getElementById('hover_window').cloneNode(true);
hover_window.setClassName('active_hover_window');
hover_window.getFirstChild().setHref(targetLink.getHref());

i tried adding both target="_blank" to the html and .setTarget("_blank") to the FBJS, to no avail.

pls advise.

1 Answer 1

0

This works in my facebook profile tab-app

<a href="http://foo.com/bar.php">Link targetting _blank for me</a> 

Link test

Facebook edits this link and adds "target" depending on the href-url specified. If it is an internal facebook target, it targets the current frame, if it is and external url, it targets blank. Please just try the link above and see if it works for you (and remove all that javascript and stuff you have)

2
  • this does not work for me, so i must be doing something very wrong. i will provide code snippets in an edit in the original post. i would appreciate your input.
    – user514998
    Dec 29, 2010 at 14:25
  • i have no idea why your code would / would not work. just a link and no javascript at all works for me, could you try that?
    – BigMomma
    Jan 3, 2011 at 11:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.