Django+ajax+jsonp实现借口调用文本处理
首页
</div>
<script src="/static/jquery-2.1.4.min.js"></script>
<script type="text/javascript">
(function (){
$.ajax({
url : "http://www.jxntv.cn/data/jmd-jxtv2.html",
type:"GET",
dataType:"jsonp",
}
)
}());
function list(e) {
console.log(e["data"]);
var obj=e["data"];
$.each(obj,function () {
console.log($(this));
//console.log($(this)[0]["week"])
var weekend=$(this)[0]["week"];
$(".shouye").append("<p>"+weekend+"</p>");
var show_list=$(this)[0]["list"];
$.each(show_list,function () {
//console.log($(this)[0]["name"])
var name=$(this)[0]["name"];
var link=$(this)[0]["link"];
$(".shouye").append("<p><a href='" +link + "'>" + name+"</a></p>")
})
})
</script>