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 '18 at 9:25
  • shared. can you please check
    – user5446
    Dec 3 '18 at 9:31
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 '18 at 9:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.