楼主: Lisrelchen
827 2

Learning from jQuery [推广有奖]

  • 0关注
  • 62粉丝

VIP

已卖:4194份资源

院士

67%

还不是VIP/贵宾

-

TA的文库  其他...

Bayesian NewOccidental

Spatial Data Analysis

东西方数据挖掘

威望
0
论坛币
50288 个
通用积分
83.6306
学术水平
253 点
热心指数
300 点
信用等级
208 点
经验
41518 点
帖子
3256
精华
14
在线时间
766 小时
注册时间
2006-5-4
最后登录
2022-11-6

楼主
Lisrelchen 发表于 2015-10-18 03:27:15 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币


  1. Book Description
  2. If you're comfortable with jQuery but a bit shaky with JavaScript, this concise guide will help you expand your knowledge of the language - especially the code that jQuery covers up for you. Many jQuery devotees write as little code as possible, but with some JavaScript under your belt, you can prevent errors, reduce overhead, and make your application code more efficient.

  3. This book explores event handling, prototypes, and working with the DOM and AJAX through examples and lots of code. You'll learn common conventions and patterns in JavaScript and - if you've never coded with JavaScript before—a tutorial will take you through the basics.
  4. Book Details
  5. Publisher:        O'Reilly Media
  6. By:        Callum Macrae
  7. ISBN:        978-1-4493-3519-9
  8. Year:        2013
  9. Pages:        116
  10. Language:        English
  11. File size:        6.4 MB
  12. File format:        PDF
  13. eBook
复制代码


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Learning earning Jquery Learn Query especially knowledge examples possible through

本帖被以下文库推荐

沙发
ReneeBK 发表于 2015-10-18 04:13:02
  1. Events in jQuery
  2. The best way to explain events is probably by using an example, and the best example (as I’m assuming that you know jQuery) is to show an extract of jQuery code that works with events. The following code turns the anchor element with ID foo red when it is clicked, and then prevents the link from being followed by calling e.preventDefault():

  3. $('a#foo').click(function (e) {
  4.         $(this).css('color', 'red');
  5.         e.preventDefault();
  6. });
  7. Events in JavaScript
  8. Following is the same code, but in pure JavaScript. It will not work in IE8 and below, which we will cover in the next section:

  9. var foo = document.getElementById('foo');
  10. foo.addEventListener('click', function (e) {
  11.         this.style.color = 'red';
  12.         e.preventDefault();
  13. });
复制代码

藤椅
ReneeBK 发表于 2015-10-18 04:15:22
  1. Event Propagation
  2. document.addEventListener('click', function (e) {
  3.         var element = e.srcElement;
  4.         if (element.tagName === 'A') {
  5.                 var url = getAnchorURL(element);
  6.                 if (isEvil(url)) {
  7.                         e.preventDefault();
  8.                         e.stopPropagation();

  9.                         // Inform user that they clicked an "evil" link
  10.                 }
  11.         }
  12. }, false);
  13. So which are fired first, bubbling or captured event listeners? Does the event start at the element, bubble up, and then capture back down again, or does it start at the document? The WC3 specifies that events should capture down from the document, and then bubble back up again, which you can see in Figure 1-3.

  14. So, say we have the following document:

  15. <!DOCTYPE html>
  16. <html>
  17. <body>
  18.         <div id="foo">
  19.                 <a href="#">Test anchor</a>
  20.         </div>
  21. </body>
  22. </html>
复制代码

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-21 13:26