1

I have code witch get cornet url in url i want add foloder/ and i get link = hostname/folder/pathname

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<a id="Link" href="#">open link</a> 
    <script> 
      $(document).ready(function(){
       var newURL = window.location.hostname + "folder/" + window.location.pathname; 
       $("#Link").attr("href", newURL);  
      });
    </script>

this code but did not works

jinko2
  • 11
  • 1

0 Answers0