I have this script:
. '<button type="button" '.($searchQuery['can_used'] == 1 ? 'onclick="var con=confirm(\'Let op: dit is de laatste keer dat u dit bestand kan downloaden, na deze keer word het bestand automatisch verwijderd. Weet u zeker dat u deze bestand wil download?\')"' : '').' class="btn btn-info">Download het bestand...</button>'
. '<script type="text/javascript">alert(con)</script>';
Well, this is not working, I get an error what says 'con is not defined'. Because the var will not exist when I not click on the button. And I cannot click on the button because javascript will not continue on an error. How can I fix this? Is there other way to to this?
Thanks!