javascript - 我在将数据从 javascript 发送到 python 烧瓶时遇到问题
问题描述
我写了一个这样的javascript和HTML代码(内容是要显示的列表)。
<script>
function popupForModifying() {
let option = "width=820, height=400, toolbar=no, menubar=no, location=no, directories=no, status=no, scrollbars=yes, resizable=no";
window.open("{{ url_for('modify', content=content[2], title=content[0], category=content[4]) }}", "", option);
}
</script>
<article>
<table class="table">
<thead>
<tr class="table-active">
<th class="col-8 text-left">{{ content[0] }}</th>
<th class="col-4"></th>
</tr>
<tr>
<td class="text-left">{{ content[4] }}
| {{ content[1] }}
| {{ content[3][0] }}</td>
</tr>
</thead>
<tbody>
<tr>
<td class="col-12 text-left">{{ content[2] }}</td>
<td class="col-0"></td>
</tr>
</tbody>
<tfoot>
<tr>
<td>
<a class="btn btn-light" href="javascript:popupForModifying()">수정하기</a>
</td>
</tr>
</tfoot>
</table>
</article>
我写了这样的python代码。
@app.route('/modify', methods=['GET'])
def modify():
title, category, content = (request.args.get(i) for i in ('title', 'category', 'content'))
return render_template('modify_content_n.html', title=title, category=category, content=content)
但是,除了标题,所有变量都没有。所以,我找到了原因。最后,我明白了原因,但这让我很困惑。这就是我找到的原因。
127.0.0.1 - - [09/Aug/2020 21:53:09] “GET /modify?title=2+입니다&content=2고요&category=데이터 HTTP/1.1”200 -
韩语只是数据。为什么是'amp;' 随附的?
解决方案
推荐阅读
- nim-lang - 模板中的 Nim 可变参数?
- spring - 在对用户进行身份验证时,我可以在标头中将第一个 jwt 以及在正文中的相关数据发送回吗?
- mysql - 基于开始日期和频率的重复检查的数据库结构
- tensorflow.js - 使用 tensorflowjs 进行文本检测
- grafana - Grafana Cloud:划分两个查询显示“无数据”
- go - 如何测试 Twirp 拦截器?
- xcode - XCode 中哪里可以获得位置更新功能?
- sails.js - Sails 模型在嵌套等待方法调用时出现无法识别的数据存储错误
- angular - Angular 项目的自托管材料图标版本 4
- java - 由于条件检查,使用 JsonParser 的杰克逊 JSON 反序列化正在跳过第一个键值对