<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<h1>后台获取结果</h1>
{{ result }}
<h1>js直接获取结果</h1>
<input type="button" value="获取数据" onclick="getContent();">
<div id="content"></div>
<script src="/static/jquery-1.12.4.js"></script>
<script>
function getContent() {
{# var xhr = new XMLHttpRequest();#}
{# xhr.open('GET','http://weatherapi.market.xiaomi.com/wtr-v2/weather?cityId=101121301');#}
{# xhr.onreadystatechange=function(){#}
{# console.log(xhr.responseText);#}
{# }#}
{# xhr.send();#}
{# var tag=document.createElement('script');#}
{# tag.src='http://127.0.0.1/jsonpp/?k1=v1&k2=v2';#}
{# document.head.appendChild(tag);#}
{# document.head.remove(tag);#}
{##}
{##}
{# }#}
{##}
//ajax方式
$.ajax({
url:'http://www.jxntv.cn/data/jmd-jxtv2.html',
type:'POST',
dataType:'jsonp',
jsonp:'callback',
jsonCallback:'list'
})
}
function list(arg) {
console.log(arg);
}
</script>
</body>
</html>