<#list (optionsSelected)! as options>
  • Freemarker integrated with javascript

    <ul id="option5" class="abc">
    
    <#list (optionsSelected)! as options>
    <li class=" ${options_index+1}">
       <a href ="${options_url}">
              ${options_description}
       </a>
    </li>
    </#list>
    </ul>
    
    
    <a href="${content_url}" onClick="abc()"; return false;">
    
    
    <script>
    function abc(){
    
        $('.nav_header li').click(function () {
               var blah = $(this).children().attr('href');
                    etc
                    etc ....
                    return false;
           }).filter(':first').click();
    
        }
    
    </script>
    

    My conclusion is as follows:

    option1 option2 option3 option4 option5

    When I click on option 1, I want to see “hey, I am option1”, When I click on option 1, I want to see “hey, I am ur second option”, When I click on option 1, I want to see “hey, what me, 3 ", etc. without reloading the page.

    I want to know how can I get this behavior in freemarkeR? I have js code for this, but how do I put this in freemarkeR? I cannot find good examples of javascript integrated with freemarker. I am completely new to freemarker,

    +4
    source share
    1 answer

    freemarker, JS .

    - :

       <a href ="${options_url}" onClick="alert('${options_description}'); return false;">
              ${options_description}
       </a>
    

    , , freemarker JS - ' " (, ).

    +1

    All Articles