首页 > js 如何获取web.py 从服务器传过来的数据

js 如何获取web.py 从服务器传过来的数据

比如有一页面

$def with (data)
<html>
<head>
<script>
 function alertSth()
 {
     // data是一个列表,我想 alert data[0]
 }
</script>
</head>
<body>
<input type="submit" onclick="alertSth()">
</body>
</html>

所以请教js代码里如何直接获取从web.py传过来的值?


假设data[0]是个str:

var data0 = "$data[0]";
【热门文章】
【热门文章】