javascript打印输出json实例
代码如下:
<!DOCTYPE html PUBliC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <script type="application/javascript" src="jquery.js"></script> <title>企业培训,it培训,数据库培训,android培训,嵌入式培训</title> </head> <body> <p>Click me!</p> </body> </html> <script language="javascript"> function handler(event) { var s=""; s=s+"{"; for(var i in event.data){ s = s + i + ":" + event.data[i] + ","; } s = s.substring(0,s.length-1); s = s+"}"; alert(s); } $("p").bind("click", {foo: "bar",f:"two"}, handler) </script>
相关推荐
nmgxzm00 2020-11-10
ifconfig 2020-10-14
hhanbj 2020-11-17
zfszhangyuan 2020-11-16
古叶峰 2020-11-16
一个智障 2020-11-15
jipengx 2020-11-12
81427005 2020-11-11
xixixi 2020-11-11
游走的豚鼠君 2020-11-10
苗疆三刀的随手记 2020-11-10
Web卓不凡 2020-11-03
小飞侠V 2020-11-02
帕尼尼 2020-10-30
爱读书的旅行者 2020-10-26
帕尼尼 2020-10-23
杏仁技术站 2020-10-23
淼寒儿 2020-10-22