Node.js中的链接列表

Lists of Links in Node.js

本文关键字:链接 列表 js Node      更新时间:2023-09-26

我正在尝试列出链接,使其显示如下:

  • 链接1
  • 链接2
  • 链接3

然后,当用户单击链接时,会出现一个对话框,将动态给定链接中的内容加载到iframe中。

当我单击第一个链接时,打开的对话框会显示正确的内容。但当我点击其他链接(链接2和链接3)时,对话框显示的是链接1的内容,而不是它们各自的链接。我是Node.js的新手,所以我不知道出了什么问题。

<div class="content">
  <ol>
  {% for ex in array1 %}
    <li>
      <div id="dlg" closed="true" class="easyui-window" title="{{ ex }}" data-options="iconCls:'icon-save'" style="width:850px;height:500px;padding:10px">
        <div class="easyui-tabs" style="width:100%;height:430px">
          <div title="Annotated Example" style="padding:5px;font-size:15px">
            <iframe src="/html/{{ path_to }}/{{ link }}/{{ ex }}" height="100%" width="100%"></iframe>
          </div>
        </div>
      </div>
      <a href="javascript:void(0)" class="easyui-link" onclick="$('#dlg').dialog('open')">
        <h5>{{ ex }}</h5>
      </a>
    </li>
  {% endfor %}
  </ol>
</div>

ID必须是唯一的。试试这个。。。

<a href="javascript:void(0)" class="easyui-link" onclick="$(this).parents('li').find('.easyui-window').dialog('open')">