#1
  1. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Location
    Zimbabwe
    Posts
    14
    Rep Power
    0

    javascript: changing browser focus???


    hi y'all,

    i'm new to javascript, but i know a little bit....

    i've got a browser default.php which, on loading, opens a FullScreen window with the following script:

    Code:
    <SCRIPT LANGUAGE="JavaScript">
    
    <!--
    var strOpt='FullScreen';
    Authorer = window.open("LOGIN.php","Authorer",strOpt);
    -->
    </SCRIPT>
    So LOGIN.php opens in a new FullScreen browser with no toolbars, title bars or anything.

    I want to have an HRef which changes the focus from the LOGIN.php browser back to the default.php browser without actually opening or closing any windows just changing the focus.

    can anyone help??
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    300
    Rep Power
    15
    Try this code:
    <a href="javascript:top.opener.focus()">Focus</a>. It should work.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Location
    (Slave only) NY, NY USA
    Posts
    34
    Rep Power
    14
    be sure to remove the extra space from between java and script that dwarf left in, or I guarantee the results will not work to well.

  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    300
    Rep Power
    15
    Jesus, I was sure I left out the space, I mean, I never write it anyway. Is there something wrong with this forum??
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Location
    Dublin
    Posts
    413
    Rep Power
    14
    The forum adds the space - as a security measure, I'd imagine.
    If you type &amp;#106;avascript: then that will show as &#106;avascript: ...
  10. #6
  11. No Profile Picture
    Senior Citizen
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2001
    Location
    leftcoast
    Posts
    2,019
    Rep Power
    16
    Try

    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;#106;&amp;#97;&amp;#118;&amp;#97;&amp;#115;&amp;#99;& amp;#114;&amp;#105;&amp;#112;&amp;#116;&amp;#58;

    adios
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    300
    Rep Power
    15
    What kind of security measure could that possibly be?? I mean, since they are using PHP and probably using htmlspecialchars() or some similar function...

    Oh well...
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Location
    Dublin
    Posts
    413
    Rep Power
    14
    I'm just guessing, but Hotmail was shown to be vulnerable to javascripts running within mails - with all sorts of possible consequences (redirects / popups asking for passwords etc.) - in this format.

    I'd imagine this is an attempt to ensure that no such vulnerability is possible here.

    With hotmail, I think the problems was with <img lowsrc="javascript:">, but I can't remember.

IMN logo majestic logo threadwatch logo seochat tools logo