V
V
viktorross2019-04-12 13:04:33
JavaScript
viktorross, 2019-04-12 13:04:33

How to pass link onclick?

hello, please tell me how to pass a link
parameter {$details_url} contains a link to the current page, but in this case it is substituted as plain text - {$details_url} .
Tried like this {$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI} - doesn't work, also displays text
What can be done in this situation?

<script>
function OpenWindow(url, windowName) {
   newwindow = window.open('https://site.ru/sharer?url=' + url, windowName, 'height=600,width=800');
   if (window.focus) {
      newwindow.focus();
   }
   return false;
}
</script>  
<button onclick="OpenWindow('{$details_url}')">Click me</button>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question