I’m using kentico to make a website. Within kentico I am using a repeater to build different pages. I have my site set up to display 6 or so thumbnails and if you click on the thumbnail from the main page it takes you to the corresponding subpage. How I set it up was to have a global variable i and add 1 to i after each thumbnail loads. That works right so we can focus on the syntax for the link itself. I want to be able to have the url be something like
page.com/page/subpage?1 where the number 1 is the variable i. I don’t quite know how to incorporate this (javascript) into the href declaration. Is there a way to do that?
I tried:
<a href="/subpage?page= <script> type='text/javascript'>document.write(i);</script>"> I tried looking this up but I couldn’t find any information to help. Any help would be appreciated. Thanks.
You can’t put a script tag into the middle of another tag. Instead, use the script to write the entire anchor tag. Watch out for unescaped quotations.