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

时间:2022-08-27 18:08:45

I am using FTL very first time. I want to access ancor tagfrom this code in jquery within FTL file and want to give style for table through jQuery. But can't get the exact syntax. Please help me anyone.

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

My FTL Code :-

我的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>

Thank you in advance..!!

先谢谢你..!!

1 个解决方案

#1


1  

FTL runs on the web server, jQuery runs in the browser after that. So FTL and JavaScript can't share variables, and only FTL can pass down values to JavaScript (via generating JavaScript assignment as output, for example). (Give a more focused demonstration of your problem if this haven't answered it.)

FTL在Web服务器上运行,之后jQuery在浏览器中运行。因此,FTL和JavaScript不能共享变量,只有FTL可以将值传递给JavaScript(例如,通过生成JavaScript赋值作为输出)。 (如果没有回答问题,请更集中地展示您的问题。)

#1


1  

FTL runs on the web server, jQuery runs in the browser after that. So FTL and JavaScript can't share variables, and only FTL can pass down values to JavaScript (via generating JavaScript assignment as output, for example). (Give a more focused demonstration of your problem if this haven't answered it.)

FTL在Web服务器上运行,之后jQuery在浏览器中运行。因此,FTL和JavaScript不能共享变量,只有FTL可以将值传递给JavaScript(例如,通过生成JavaScript赋值作为输出)。 (如果没有回答问题,请更集中地展示您的问题。)