Reset focus to hyperlink on XUL dialog

Discussion in 'Javascript' started by Samuel Saint-Pettersen, Jan 3, 2007.

  1. Hello everyone,

    I am having problems with my chromeless pop up window (i.e. no titlebar)
    to reset focus to the hyperlink that called it.

    I have this code:

    <!-- begin JS snippet (external JavaScript file) -->

    var popupTip;
    function showTip()
    {
    popupTip = window.open
    ('tip.xml','popuptip','chrome,titlebar=no,height=50,width=300,centerscreen');
    document.getElementById("tip1").focus();
    }
    function closeTip()
    {
    popupTip.close();
    }

    <!-- end snippet -->

    As you can see I tried using "document.getElementById.." to regain focus
    to the link. But for some reason this does not work.

    <!-- begin HTML snippet in XUL dialog -->

    <html:a id="tip1" onmouseover="javascript:showTip();"
    onmouseout="javascript:closeTip();"
    style="text-decoration: none; border-bottom: dotted 1px;">
    vB code</html:a>

    <!-- end snippet -->

    I have given my link an ID, so the above theoretically should work, but
    it does not.

    Can anyone suggest an alternative method for regaining focus to the link
    or highlight any mistakes I may have made which prevents my code
    working. Thanks in advance.


    Samuel.
    Samuel Saint-Pettersen, Jan 3, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael Nicklas

    library xul;

    Michael Nicklas, Jul 10, 2003, in forum: VHDL
    Replies:
    3
    Views:
    1,503
    Amontec Team
    Jul 11, 2003
  2. Herr Fuchs
    Replies:
    2
    Views:
    823
  3. Thomas G. Marshall
    Replies:
    15
    Views:
    749
    Alex Hunsley
    Feb 17, 2004
  4. Need Xul Help!!!!

    , Dec 26, 2005, in forum: XML
    Replies:
    1
    Views:
    451
    Janwillem Borleffs
    Dec 26, 2005
  5. Roger
    Replies:
    3
    Views:
    296
Loading...

Share This Page