如何在FTL中访问Jquery的变量?

时间:2015-11-23 11:42:27

标签: javascript jquery freemarker

我第一次使用FTL。我想在ancor tag文件中的jquery中从此代码中访问FTL,并希望通过jQuery为表格提供样式。但是无法获得确切的语法。请帮助我。

我的FTL代码: -

<#import "HeaderCommon.ftl" as c/>
     <@c.page title=" Manpreet Singh Title">
  <div>
    <table border="1" align="center" style="width:50%">
       <thead>
            <tr>
                <th>Sr.No</th>
                <th>Name</th>
                <th>Website</th>
            </tr>
       </thead>

     <tbody> 
      <#assign c=merchantstemp.getOffset()+1>
     <#list merchantstemp.results as m >
            <tr>
                  <td>${m_index + c}</td>
                  <td>${m.name}</td>
                  <td>${m.website!""}</td>
            </tr>   
     </#list>   


    </tbody> 
    </table>
    </br>
    <center>
    <#assign n=merchantstemp.pgNum>
        <#if (merchantstemp.prevPages() > 0 && itemsPerPageStr?has_content) >

                <#if (n>=2)>    
                  <#assign j= n-2>  
                  <a href="/mer?pgNum=${j}&ipp=${itemsPerPageStr}">${j}</a>
                   <#assign i= n-1>
                   <a href="/mer?pgNum=${i}&ipp=${itemsPerPageStr}">${i}</a>
                     ${n}
                   <#assign k= n+1>
                   <a href="/mer?pgNum=${k}&ipp=${itemsPerPageStr}">${k}</a>
                   <#assign t= n+2>
                     <a href="/mer?pgNum=${t}&ipp=${itemsPerPageStr}">${t}</a>
                 </#if>
        <#else>

            <#if (n>=2)>  
             <#assign j= n-2>  
             <a href="/mer?pgNum=${j}">${j}</a>
             <#assign i= n-1>
             <a href="/mer?pgNum=${i}">${i}</a>
             ${n}
             <#assign k= n+1>
             <a href="/mer?pgNum=${k}">${k}</a>
             <#assign t= n+2>
             <a href="/mer?pgNum=${t}">${t}</a>
            </#if>
       </#if>


    <#if (merchantstemp.prevPages() > 0 && itemsPerPageStr?has_content) >

       <a href="/mer?pgNum=${merchantstemp.pgNum -1}&ipp=${itemsPerPageStr}"> &it;Pre;</a>

       <#else>
       <a href="/mer?pgNum=${merchantstemp.pgNum - 1}"> &it; Pre </a>
    </#if>

    <#if (merchantstemp.nextPages() > 0 && itemsPerPageStr?has_content) >
      <a href="/mer?pgNum=${merchantstemp.pgNum + 1}&ipp=${itemsPerPageStr}">Next &gt;</a>

    <#else>
    <a href="/mer?pgNum=${merchantstemp.pgNum + 1}">Next &gt;</a>
   </#if>

     </@c.page>
     </center>  
  </div>   
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Show All Merchants</title>
</head>

<body>

</body>
</html>

提前谢谢.. !!

0 个答案:

没有答案