0

I am new to JS. I have asp.net mvc application, in which cookies “privacy statement” is already implemented.

Screenshot example.

screenshot of privacy statement that I would like to open in new tab

I believe it’s implemented Like below.

    <script src=“https://banner.example.com/JavaScript/ compliance.main.js” type=“text/JavaScript “></script>

   <link href=“https://banner.example.com/css/banner.css”rel = “stylesheet” type=“text/css”/>

  <Dev Id = “Aucookies-banner”>
      <Dev>
        <span Id = “aucookies-bannertext”></span>
        <a Id = “aucookies-privacylink”>
         <span Id = “aucookies-privacytext”></span>
        </a>
        </Dev>
   </Dev>

<script type=“text/JavaScript “>
 $(document).ready(function() {
    aucookiesimplementationrun(“en-us”, “website.com”);
    $(function (){
       $(‘#region’).on(‘change’,function (){
       Var url = $(this).val();
       If(url){
        window.location = url; // redirect
   }
  Return false;
 }); });

I would like to open this cookies url (that is “privacy statement “ ) in a new tab in the same browser. How can I do this? Thanks.

AskMe
  • 2,495
  • 8
  • 49
  • 102
  • Does this answer your question? [Open a URL in a new tab (and not a new window)](https://stackoverflow.com/questions/4907843/open-a-url-in-a-new-tab-and-not-a-new-window) – Bagus Tesa Mar 15 '20 at 09:29
  • Thank you for the link.I have “privacy statement “ in both header and footer. The link you have given is working fine when I implemented in footer. However, for the header pop off it’s not working. Please note that, the header is showing like the image shown in the question. Any clue please? – AskMe Mar 15 '20 at 10:56
  • hi AskMe, i am not really sure, your code only shows when element with `region` "changed" you will open a redirect. it doesnt show your header or footer. i have no clue how it should be working or how it looked like. if you could share more of the code, that would be helpful. i gave you that link given you want to open a new tab via js. – Bagus Tesa Mar 17 '20 at 23:42

0 Answers0