Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Node.js中的链接列表_Javascript_Jquery_Node.js_List_Web Applications - Fatal编程技术网

Javascript Node.js中的链接列表

Javascript Node.js中的链接列表,javascript,jquery,node.js,list,web-applications,Javascript,Jquery,Node.js,List,Web Applications,我试图列出链接,如下所示: 链接1 链接2 链接3 然后,当用户单击链接时,会出现一个对话框,将动态给定链接中的内容加载到iframe中 单击第一个链接时,打开的对话框将显示正确的内容。但是,当我单击其他链接(Link2和Link3)时,对话框显示的是link1的内容,而不是它们各自的链接。我是Node.js的新手,所以我无法找出哪里出了问题 <div class="content"> <ol> {% for ex in array1 %} <l

我试图列出链接,如下所示:

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

单击第一个链接时,打开的对话框将显示正确的内容。但是,当我单击其他链接(Link2和Link3)时,对话框显示的是link1的内容,而不是它们各自的链接。我是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>

{数组1%中的ex为%1}
  • {%endfor%}
    ID必须是唯一的。试试这个

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

    虽然我也在考虑同样的问题,但我不知道如何实现它……上面的代码片段不起作用……链接无法打开对话框