jQuery基础教程-第6章练习
来源:互联网 发布:cs5463数据手册 编辑:程序博客网 时间:2024/06/03 02:27
06.js
$(document).ready(function(){ var dictionary=$('#dictionary'); //Answer 1 dictionary.load('exercises-content.html .letter'); //Answer 2 $('.letter').mouseenter(function(e){ var letterId=this.id; console.log(letterId); dictionary.load('exercises-content.html #'+letterId); }).mouseleave(function(e){ dictionary.html(''); }); //Answer 3 $('.letter').mouseenter(function(e){ var letterId=this.id; console.log(letterId); dictionary.load('does-not-exist.html #'+letterId, function(response,status,xhr){ if(status == "error"){ dictionary.html('An error occurred: ' + xhr.status) .append(xhr.responseText); } }); }).mouseleave(function(e){ dictionary.html(''); }); //Answer 4 $.getJSON("http://examples.learningjquery.com/jsonp/g.php?callback=?",function(data){ var html=''; $.each(data, function(i,item){ html += '<div class="entry">'; html += '<h3 class="term">'+ item.term + '</h3>'; html += '<h3 class="part">'+ item.part +'</h3>'; html += '<div class="definition">'+ item.definition; if(item.quote){ html +='<div class="quote">'; $.each(item.quote, function(qi,qitem){ html += '<div class="quote-line">'+ qitem +'</div>'; }); html +='</div>'; } if(item.author){ html +='<div class="quote-author">' + item.author +'</div>'; } html += '</div>'; html += '</div>'; }); dictionary.append($(html)); });});
- jQuery基础教程-第6章练习
- jQuery基础教程-第5章练习
- jQuery基础教程-第4章练习
- jQuery基础教程-第3章练习
- jQuery基础教程-第2章练习
- jQuery基础教程(第3版)练习参考答案(第2~6章)
- 第七天 JQuery基础教程
- 学习笔记:《jQuery基础教程》第四版第二章课后练习
- 学习笔记:《jQuery基础教程》第四版第三章课后练习
- 《JQuery基础教程》第四版课后练习代码--第三章
- 《JQuery基础教程》第四版课后练习代码--第四章
- 《JQuery基础教程》第四版课后练习代码--第五章
- 《JQuery基础教程》第四版课后练习代码--第六章
- jQuery基础教程第四版 第3章学习笔记
- Python基础教程之第6章 抽象
- 【Python基础教程】第6章 函数
- Python基础教程第4-6章笔记
- 【书山有路】Python基础教程 第6章
- 云计算 appfog,heroku,openshift都是什么?
- 日本游戏开发公司谈:如何在激烈的APP世界立足
- Windows下配置Cassandra
- java IO流之二 IO流操作
- Linux操作系统内核启动参数详细解析 [转]
- jQuery基础教程-第6章练习
- JavaScript性能优化--innerHTML的感悟
- Subversion快速入门教程
- 【又是转载】关于批处理
- 微信验证开发者代码,解决微信请求URL超时,你的服务器没有正确响应Token验证,请阅读消息接口使用指南
- 分布式和集群
- Apache Derby -上手2
- Spring中@Autowired注解、@Resource注解的区别
- svn move修改名称