Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Nov 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to open in new window (webster search)

    I hope I am in the correct place

    I am adding merriam-webster search to my page and I would like the search to open in a new window but I can't figure out how.

    I already tried target="_base"
    but when the new window opens it only loads a blank page.

    Here is my html code
    Code:
    <!-- Merriam-Webster Searchbox Style 9 -->
                <script language="Javascript">
                function getValue(term){if(document.query.elements[0].checked == true){document.location.href = "http://www.merriam-webster.com/dictionary/" + term;}
                else if(document.query.elements[1].checked == true){document.location.href = "http://www.merriam-webster.com/thesaurus/" + term;}}
                </script>
                <form name="query" method="get" action="javascript:getValue(document.query.va.value)">
                <div style="margin:0;padding:0;border:solid 1px #000000;width:502px;">
                <div style="margin:0;padding:0;background-color:#dfe6ff;">
                <table cellpadding="0" cellspacing="0" style="margin:0;padding:0;font-family:Geneva,Arial,Helvetica,sans-serif;font-size:11px;font-weight:bold;color:#010066;">
                <tr>
                <td style="margin:0;padding:0;" width="150">
                <img src="http://www.merriam-webster.com/images/searchbox/hdr_500x32.gif" width="149" height="32" hspace="0" vspace="0" align="left" />
                </td>
                <td width="175" align="center" valign="middle" style="margin:0;padding:3px;vertical-align:middle;">
                <input type="radio" name="mySelect" value="Dictionary" checked>Dictionary
                <input type="radio" name="mySelect" value="Thesaurus">Thesaurus
                </td>
                <td width="175" valign="middle" style="margin:0;padding:3px;vertical-align:middle;">
                <input type="text" align="top" name="va" size="24">
                <input type="image" src="http://www.merriam-webster.com/images/searchbox/btn_go_19x18_blue_matte.gif" alt="Go" width="19" height="18" border="0" style="vertical-align:-25%;">     
                </td>
                </tr>
                </table>
                </div>
                </div>
                </form>
    Thanks for any help

  • #2
    Regular Coder
    Join Date
    Apr 2008
    Location
    Manila, Philippines
    Posts
    263
    Thanks
    3
    Thanked 12 Times in 12 Posts
    it's target="_blank"

  • #3
    Regular Coder
    Join Date
    Aug 2005
    Location
    MS
    Posts
    836
    Thanks
    10
    Thanked 79 Times in 77 Posts
    target="_blank" is for frame or transitional doctypes only. Since you are using JS already, you could use:
    Code:
    onclick="window.open (this.href, ''); return false"
    ☠ ☠RON☠ ☠

  • #4
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    I suggest you have a peek at one of my favorite articles regarding the problems with opening new windows. Plus it's really annoying.

  • #5
    Regular Coder
    Join Date
    Aug 2005
    Location
    MS
    Posts
    836
    Thanks
    10
    Thanked 79 Times in 77 Posts
    Technically, modern day browsers can not be made to do what a web site wants when a link is clicked and that is the way it should be. User should have control over their browser's actions...not a web site!

    I have my browsers' options set to open links the way I want them to be open. I also do not allow JavaScript to be turned on unless I click the little button to do so. Even then, I control what JS runs on each page. Therefore, the onClick events do not work for me.

    Users have the option to right-click any link and chose from the context menu to open in a new tab or window. I personally use the keyboard keys that give me the option I want before clicking the link.
    ☠ ☠RON☠ ☠


  •  

    Posting Permissions

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