json
来源:互联网 发布:羊毛衫工艺软件 编辑:程序博客网 时间:2024/05/16 10:55
json获取数据,并且动态加载js.
<script type="text/javascript">
$(document).ready(function(){
$.ajax({
type:"GET",
url:"http://ip:port/系统域名/json/模型名",
dataType:"json",
contentType : 'application/json;charset=UTF-8',
async:false,
timeout:2000,
success:function(data) {
$("#tableUser>tbody").empty();
var strResult = "";
if(data!=null&&data!=""){
for(var i=0;i<data.items.length;i++){
var users = data.items[i];
strResult +="<tr>";
strResult+="<td>"+users.username+"</td>";
strResult+="<td class='center'>"+users.registerDate+"</td>";
strResult+="<td class='center'>"+users.email+"</td>";
strResult+="<td></td>";
strResult+="<td><a class='btn btn-success' href='#'>"+
"<i class='glyphicon glyphicon-zoom-in icon-white'></i>View"+
"</a></td>";
strResult +="</tr>";
$("#tableUser>tbody").append(strResult);
strResult ="";
}
}
},
error : function() {
//alert();
alert("error.");
}
});
})
json获取数据,并且动态加载js.
</script>
<!-- application script for Charisma demo -->
<script src="js/charisma.js" async=false></script>
要点:设置ajax同步,设置要加载的js同步。
- Json
- JSON
- JSON
- JSON
- json
- JSON
- JSON
- json
- Json
- json
- JSON
- json
- json
- JSON
- json
- JSON
- JSON
- json
- nim misere game anti-sg
- tomcat,zookeeper,activeMQ,Kafka设置jvm参数
- 原快播团队再创业 推新应用“视频头条”
- 异常最诡异第二期之 Jedis pool.returnResource(jedis)
- 关于字符串匹配Sunday算法的个人想法
- json
- iOS程序自动检测更新的实现
- IOS tableview 取消选择与获得当前cell
- 笔记92--将崩溃信息保存到本地(上)
- 高斯拉普拉斯算子(Laplace of Gaussian)
- kafka-storm spout拉取数据问题offset out of range(todo)
- Java中float的取值范围
- DNS详解(二)
- 美团性能优化之路——性能指标体系