Open link in new window

Discussion in 'JavaScript' started by JWRmedia, Oct 28, 2008.

  1. #1
    Sounds easy enough. Only I cant get it to work with the following code inside a .js file:

    	var bottomToolbar = [];
    	bottomToolbar.push({
    	text: FR.T('Help'),
    	handler:function(){
    	document.location.href = 'http://example.com/help.html';
    	},
    	icon: FR.baseURL+'/images/page_white_go.gif',
    	cls: 'x-btn-text-icon'
    	});
    Code (markup):
    Does anyone know how I can modify this to make example.com/help.html open in a new window when the button is clicked? Right now it opens in the same window.

    Thanks
     
    JWRmedia, Oct 28, 2008 IP
  2. MediaPlay

    MediaPlay Banned

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    window.open='http://example.com/example.html'
    Code (markup):
    Try this one ..:rolleyes:
     
    MediaPlay, Oct 28, 2008 IP
  3. JWRmedia

    JWRmedia Banned

    Messages:
    499
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yeah, unfortunately I tried that one and nothing happens when you click the button. :(
     
    JWRmedia, Oct 28, 2008 IP
  4. MediaPlay

    MediaPlay Banned

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    <script type="text/javascript">
    function OpenWindow() {
    windowHandle = window.open('http://www.google.com','Google','width=500,height=500,location=yes'); windowHandle.focus(); }
    </script>
    
    <form>
    <input type="button" value="Open Window" onClick="OpenWindow()">
    </form>
    Code (markup):
    Instead of using document.location, add a function witch will open a new window :p
     
    MediaPlay, Oct 28, 2008 IP
  5. rhoula

    rhoula Well-Known Member

    Messages:
    875
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    145
    #5
    I already made the script for you.
    If you want to make a small donation please feel Free. :D
    Thank you
     
    rhoula, Oct 28, 2008 IP