【发布时间】:2019-05-10 19:41:48
【问题描述】:
所以我试图为 ctf 解决问题,而对于问题,我需要将数据从 python 脚本发送到 javascript。谁能告诉我怎么做?
我的html代码是:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1 class="text">text</h1>
<script>
$.get("[website]/cgi-bin/challenge.py",
function(data) {
$(".text").html(data);
});
</script>
</body>
</html>
我将网站替换为 [网站]。 python代码是这样的:
#!/usr/bin/python
import json
print "Content-type: text/html\n\n"
json.dumps("It works!")
【问题讨论】:
-
发布的问题似乎根本没有包含any attempt 来解决问题。 StackOverflow 期待您 try to solve your own problem first,因为您的尝试有助于我们更好地了解您想要什么。请编辑问题以显示您尝试过的内容,以说明您在minimal reproducible example 中遇到的特定问题。欲了解更多信息,请参阅How to Ask 并拨打tour。
-
在那里我添加了我尝试过的代码。很抱歉 - 我不知道。