CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 1999
    Posts
    3

    Opening Java script links in a new window from a framed web page

    hello, I am using this script in a framed web page,

    <TITLE>make a choice</TITLE>

    <SCRIPT LANGUAGE="JavaScript">

    </SCRIPT>

    <CENTER><FORM NAME="links">
    <SELECT>
    <OPTION VALUE="no link">Make a choice
    <OPTION VALUE="http://www.htmlgoodies.com">HTMLgoodies
    </SELECT>
    <INPUT TYPE="button" VALUE="Go!"
    onClick="menu(this.form.elements[0])">
    </FORM></CENTER>

    HTML programming lets you use Target="_top" with a url in an
    AHREF command to open the url or link in a new window, I have
    tried using the target command in a number of places within the
    script and option commands no luck, what do I need to do to get
    the selected option url to open in it's own window? Currently the
    script opens the link in the window where the script is located.
    Any help would be greatly appreciated.


  2. #2
    Join Date
    May 1999
    Location
    Pune, MH, India.
    Posts
    453

    Re: Opening Java script links in a new window from a framed web page

    U can try using 'document.open' method. It creates new browser window, and then give it the url u want.

    - UnicMan
    http://members.tripod.com/unicman

  3. #3
    Join Date
    Oct 1999
    Posts
    3

    Re: Opening Java script links in a new window from a framed web page

    thanks for the command UnicMan, but I am new to java scripting and need to know where to place the command and the syntax associated to it to make it work


  4. #4
    Join Date
    May 1999
    Location
    Pune, MH, India.
    Posts
    453

    Re: Opening Java script links in a new window from a framed web page

    I have some code that will help u...

    function DoProperties()
    {
    var iHeight=250;
    var iWidth=300;
    var iTop=0;
    var iLeft=0;
    var sUrl='';

    iTop=SetWindowTopPosition(iHeight)-10;
    iLeft=SetWindowLeftPosition(iWidth);
    if (window.navigator.appName=="Microsoft Internet Explorer")
    {
    var out = window.open(
    "test.asp",
    "",
    "top=" + iTop + ",left="+ iLeft + ",width=" + iWidth + ",height=" + iHeight +
    ",resizable=0,scrollbars=no"
    );
    }
    else if (window.navigator.appName=="Netscape")
    {
    var out = window.open(
    "test.asp",
    "",
    "screenY=" + iTop + ",screenX=" + iLeft +",width=" + iWidth + ",height=" + iHeight +
    ",resizable=0,scrollbars=no"
    );
    }
    }

    - UnicMan
    http://members.tripod.com/unicman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured