简体   繁体   中英

How to make this dynamic link open new tab?

 <a style="text-decoration:underline;" href="https://mydomain.com/register/<?php echo $locat?>">CONTINUE BROWSING &raquo;</a>

Hey guys i have 3 different registration user types that all go to my "payment page" where i display 3 different packages..

i have one of those contiinue browsing links but if a user clicks that they cant go back because the unique token expires....

i want this link to open a new tab or page when they click it this way i dont have to worry if a user was just click the link to see what it was but then cant go back to actually sign up.... ive read online but it keeps causing errors on page when i try to do it./

Any tips, i appreciate sorry for the easy question but i do appreciate it.

<a target="_blank" href="https://yourwebsite.com/">link name</a>

or you could use <a rel="ext" href="external website>link name</a> and have a script add target="_blank" to all anchors with rel="ext" once the document is loaded.

Example:

<script type="text/javascript" src="jquery-1.8.2.min.js"></script>
<script type="text/javascript">
  $(document).ready(function() {
    $(document).find('a[rel="ext"]').attr("target", "_blank");
  });
</script>
...
<body>
   <a rel="ext" href="some website">some name</a>

Use <a target="blank" href="yourlink">link name</a> Because blank instead of _blank will force the browser to open the same tab if the link is clicked again which is pretty nice for me. So try it out

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM