【发布时间】:2013-10-05 13:46:12
【问题描述】:
我正在使用window.open 方法在myhtml 中打开一个新网页。但是当我在 Firefox 中运行它时,它会重新加载同一页面。但它适用于 Chrome 和 Safari。这是我的 html 和 javascript sn-p。我正在使用 Python Flask framework 和 Jinja 模板。我也尝试使用location.replace 而不是window.open
</div>
<form name="items">
<script type="text/javascript" language="javascript">
function getdetails(name){
window.open("/details?name="+name,"_self")
}
</script>
<table id="main" align="center" class="table table-striped table-bordered" >
<thead>
<tr>
<th> <strong> SNo </strong></th>
<th> <strong> name </strong></th>
<th> <strong> item </strong></th>
<th> <strong> Total numbers </strong></th>
<th> <strong> size </strong></th>
</tr>
</thead>
{% set count = 1 %}
<tbody id="tablebody">
{% for i in rows %}
{% for name,values in i.iteritems() %}
<tr>
<td style="text-align: center"> {{ count }}</td>
<td> <a href=# id=link onclick="getdetails('{{ name }}');"> {{ name }} </a> </td>
{% for j in values %}
<td> {{ j }} </td>
{% endfor %}
</tr>
{% endfor %}
{% set count = count + 1 %}
{% endfor %}
</tbody>
</table>
</form>
</div>
【问题讨论】:
-
您想将其作为新标签页或新弹出窗口打开吗?
-
我有点不清楚,你是想在新窗口中打开内容还是在同一窗口中打开不同的页面?
-
我需要打开一个新标签。无需打开弹出窗口
标签: javascript python html firefox jinja2