0

I am trying to open new browser window to open with tab. currently it's display like this,

enter image description here

I want to display like this,

enter image description here

VF code:

<apex:page >
<script type="text/javascript">
    function redirect(){
        var link = "www.google.com";
        window.open(link,'newwindow','resizable=yes');  
    }
</script>
<apex:form >
    <apex:commandButton onclick="redirect()" value="Click"/>  
</apex:form>
</apex:page>
2
  • can you share your code? Dec 3, 2018 at 9:25
  • shared. can you please check
    – user5446
    Dec 3, 2018 at 9:31

1 Answer 1

0

You should use _blank instead of 'newwindow'.

<script type="text/javascript">
    function redirect(){
        var link = "www.google.com";
        window.open(link,'_blank','resizable=yes');  
    }
</script>
1
  • its not working i tried it
    – user5446
    Dec 3, 2018 at 9:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .