{{sellerTotalView > 1 ? __("sellers", {number: sellerTotalView}) : __("seller", {number: sellerTotalView}) }}, {{numTotalView > 1 ? __("items", {number: numTotalView}) : __("item", {number: numTotalView}) }}
free FREE

Change Your Zip Code

Inventory information and delivery speeds may vary for different locations.

Location History

{{email ? __('Got it!') : __('Restock Alert')}}

We will notify you by email when the item back in stock.

Cancel
Yami

Jingdong book

编写高质量代码:Web前端开发修炼之道

{{buttonTypePin == 3 ? __("Scan to view more PinGo") : __("Scan to start")}}

编写高质量代码:Web前端开发修炼之道

{{__(":people-members", {'people': item.limit_people_count})}} {{ itemCurrency }}{{ item.valid_price }} {{ itemCurrency }}{{ item.invalid_price }} {{ itemDiscount }}
Ends in
{{ itemCurrency }}{{ item.valid_price }}
{{ itemCurrency }}{{ priceFormat(item.valid_price / item.bundle_specification) }}/{{ item.unit }}
{{ itemDiscount }}
{{ itemCurrency }}{{ item.valid_price }} {{ itemCurrency }}{{ priceFormat(item.valid_price / item.bundle_specification) }}/{{ item.unit }} {{ itemCurrency }}{{ item.invalid_price }} {{itemDiscount}}
{{ itemCurrency }}{{ item.valid_price }}
Sale ends in
Sale will starts after Sale ends in
{{ getSeckillDesc(item.seckill_data) }}
{{ __( "Pay with Gift Card to get sale price: :itemCurrency:price", { 'itemCurrency' : itemCurrency, 'price' : (item.giftcard_price ? priceFormat(item.giftcard_price) : '0.00') } ) }} ({{ itemCurrency }}{{ priceFormat(item.giftcard_price / item.bundle_specification) }}/{{ item.unit }}) Details
Best before

Currently unavailable.

We don't know when or if this item will be back in stock.

Unavailable in your area.
Sold Out

Details

Full product details
Editer Recommend

Web前端开发者的内功修炼秘笈
4大社区鼎立推荐!
在这个用户体验为王的Web 2.0时代,Web应用所涉及的领域越来越广,规模越来越大,需求越来越多样化和复杂化,更新的速度也越来越快。如何才能让我们的应用应对规模化、多样化、复杂化和快速变化带来的种种问题?编写高质量的、易于维护的Web前端代码似乎是解决这些问题的惟一途径。
如何才能编写出高质量的、易于维护的Web前端代码?《编写高质量代码:Web前端开发修炼之道》的主要内容围绕Web前端开发的三大技术要素——HTML、CSS和JavaScript展开,深入地讨论了编写高质量的HTML代码、CSS代码和JavaScript代码的方法、技巧、规范和实践,从而为编写易于维护的Web前端代码打下坚实的基础。希望《编写高质量代码:Web前端开发修炼之道》能帮助大家从一筹莫展的前端维护工作中走出,从此微笑地面对需求的“变化”。
互联网进入Web 20时代以后,Web应用敲响了传统桌面应用的丧钟,它一路摧城拔寨,如今几乎所有的应用都打上了“Web”的烙印。与之相应的,Web开发技术得到了空前的发展,尤其是前端技术。近年来,随着用户对使用体验的要求越来越高,前端开发的技术难度越来越大,昔日设计和制作不分的网页设计师这一职位终于“拆分”成了视觉设计师和前端开发工程师两个职位,分别向着艺术和技术的方向纵深发展。
Web前端开发工程师是一个很新的职业,在国内乃至国际上真正开始受到重视的时间也不超过5年,这类专业人才一直供不应求。从知识体系上讲,前端开发工程师需要掌握和了解的知识非常之多,甚至可以用庞杂来形容。作为一名没有太多经验的前端开发工程师,我们应该如何去全面认识自己的工作,如何找准自己的定位,如何从合格成为优秀,最后迈向卓越?《编写高质量代码:Web前端开发修炼之道》尝试从如何编写易于维护的、高质量的Web前端代码的角度给出答案。
如果你在思考下面这些问题,也许《编写高质量代码:Web前端开发修炼之道》就是你想要的!
作为一名合格的web前端开发工程师,究竟需要具备哪些技能和素质?为什么说如果要精Web前端开发这一行,必须先精通十行?
在Web应用的实现代码中,有哪些技术因素会导致应用难以维护?
高质量的Web前端代码应该满足哪些条件?如何才能提高Web前端代码的可读性和可重用性?
在HTML代码中,为何要使用语义化标签?如何检查你使用的标签是否语义良好?语义化标签时应该注意哪些问题?
如何编写CSS代码和JavaScript代码可以避免团队合作时产生冲突?
如何组织CSS文件才能让它们更易于管理?如何让CSS模块化,从而提高代码的重用率?CSS的命名应该
注意哪些问题?何谓优良的CSS编码风格?
如何在CSS编码中引入面向对象的编程思想?这样做有哪些好处?
原生JavaScript和JavaScript类库之间有何关系?如何编写自己的JavaScript类库?
JavaScript有哪些常见的跨浏览器兼容问题?如何解决这些问题?
如何组织JavaScript才能让代码的结构更清晰有序,从而更易于维护?如何才能编写出弹性良好的JavaScript
代码?编写过程中应该注意哪些问题?
JavaScript的对象编程是如何实现的?如何用面向对象的方式重写原有的代码?
编写高质量的JavaScript代码有哪些实用的技巧?又有哪些常见的问题需要注意?
为了提高Web前端代码的可维护性,我们应该遵循哪些规范?

更多精彩好书推荐,请点击以下图片查看:

Content Description

《编写高质量代码:Web前端开发修炼之道》以网站重构为楔子,深刻而直接地指出了Web前端开发中存在的重要问题-代码难以维护。如何才能提高代码的可维护性?人是最关键的因素!于是《编写高质量代码:Web前端开发修炼之道》紧接着全方位地解析了作为一名合格的前端开发工程师应该掌握的技能和承担的职责,这对刚加入前端开发这一行的读者来说有很大的指导意义。同时,还解读了制定规范和团队合作的重要性。
《编写高质量代码:Web前端开发修炼之道》的核心内容是围绕Web前端开发的三大技术要素——HTML、CSS和JavaScript来深入地探讨编写高质量的HTML代码、CSS代码和JavaScript代码的方法、技巧、规范和实践,从而为编写易于维护的Web前端代码打下坚实的基础。这不是一本单纯的“技术”书籍,没有系统地讲解Web前端开发的基础知识,它更专注于“技巧”,探索如何为“技术”提供“技巧”。
《编写高质量代码:Web前端开发修炼之道》包含了大量的开发思想和原则,都是作者在长期开发实践中积累下来的经验和心得,不同水平的Web前端开发者都会从中获得启发。尤其是对于那些中初级水平的读者而言,《编写高质量代码:Web前端开发修炼之道》是一本不可多得的内功修炼秘籍。
Author Description

曹刘阳,网名阿当,资深Web前端开发工程师,先后就职于中国雅虎和淘宝,现就职于新浪,一直从事Web前端开发工作,实战经验非常丰富,在通过提高代码 质量来增强可维护性方面颇有心得。精通HTML、CSS、JavaScript等前端开发技术,对ActionScript、Flex、PHP、RoR等 Web开发技术也有较深入的研究。致力于敏捷开发实践,喜欢读书,阅读过大量技术书籍;擅于总结归纳,能将各种技术融会贯通。
Catalogue

推荐序
赞誉
前言
致谢
第1章 从网站重构说起
1.1 糟糕的页面实现,头疼的维护工作
1.2 Web标准-结构、样式和行为的分离
1.3 前端的现状
1.4 打造高品质的前端代码,提高代码的可维护性-精简、重用、有序

第2章 团队合作
2.1 揭秘前端开发工程师
2.2 欲精一行,必先通十行
2.3 增加代码可读性-注释
2.4 提高重用性-公共组件和私有组件的维护
2.5 冗余和精简的矛盾-选择集中还是选择分散
2.6 磨刀不误砍柴工-前期的构思很重要
2.7 制订规范
2.8 团队合作的最大难度不是技术,是人

第3章 高质量的HTML
3.1 标签的语义
3.2 为什么要使用语义化标签
3.3 如何确定你的标签是否语义良好
3.4 常见模块你真的很了解吗
3.4.1 标题和内容
3.4.2 表单
3.4.3 表格
3.4.4 语义化标签应注意的一些其他问题

第4章 高质量的CSS4
4.1 怪异模式和DTD
4.2 如何组织CSS
4.3 推荐的base.css
4.4 模块化CSS-在CSS中引入面向对象编程思想
4.4.1 如何划分模块-单一职责
4.4.2 CSS的命名-命名空间的概念
4.4.3 挂多个class还是新建class-多用组合,少用继承
4.4.4 如何处理上下margin
4.5 低权重原则-避免滥用子选择器
4.6 CSS sprite
4.7 CSS的常见问题
4.7.1 CSS的编码风格
4.7.2 id和class
4.7.3 CSS hack
4.7.4 解决超链接访问后hover样式不出现的问题
4.7.5 hasLayout4
4.7.6 块级元素和行内元素的区别
4.7.7 display: inline-block和hasLayout7
4.7.8 relative、absolute和float3
4.7.9 居中4
4.7.10 网格布局
4.7.11 z-index的相关问题以及Flash和IE6下的select元素
4.7.12 插入png图片
4.7.13 多版本IE并存方案-CSS的调试利器IETester

第5章 高质量的JavaScript
5.1 养成良好的编程习惯
5.1.1 团队合作-如何避免JS冲突
5.1.2 给程序一个统一的入口-window.onload和DOMReady
5.1.3 CSS放在页头,JavaScript放在页尾
5.1.4 引入编译的概念-文件压缩
5.2 JavaScript的分层概念和JavaScript库
5.2.1 JavaScript如何分层
5.2.2 base层3
5.2.3 common层
5.2.4 page层4
5.2.5 JavaScript库
5.3 编程实用技巧7
5.3.1 弹性7
5.3.2 getElementById、getElementsByTagName和getElements-ByClassName3
5.3.3 可复用性
5.3.4 避免产生副作用9
5.3.5 通过传参实现定制3
5.3.6 控制this关键字的指向7
5.3.7 预留回调接口
5.3.8 编程中的DRY规则
5.3.9 用hash对象传参
5.4 面向对象编程
5.4.1 面向过程编程和面向对象编程
5.4.2 JavaScript的面向对象编程
5.4.3 用面向对象方式重写代码
5.5 其他问题
5.5.1 prototype和内置类
5.5.2 标签的自定义属性
5.5.3 标签的内联事件和event对象
5.5.4 利用事件冒泡机制
5.5.5 改变DOM样式的三种方式

附录A 写在规则前面的话
附录B 命名规则
附录C 分工安排
附录D 注释规则
附录E HTML规范
附录F CSS规范
附录G JavaScript规范
Introduction

Web前端开发是从网页制作演变而来的,名称上有很明显的时代特征。在互联网的演化进程中,网页制作是Web 1.0时代的产物,那时网站的主要内容都是静态的,用户使用网站的行为也以浏览为主。2005年以后,互联网进入Web 2.0时代,各种类似桌面软件的Web应用大量涌现,网站的前端由此发生了翻天覆地的变化。网页不再只是承载单一的文字和图片,各种富媒体让网页的内容更加生动,网页上软件化的交互形式为用户提供了更好的使用体验,这些都是基于前端技术实现的。
以前会Photoshop和Dreamweaver就可以制作网页,现在只掌握这些已经远远不够了。无论是开发难度上,还是开发方式上,现在的网页制作都更接近传统的网站后台开发,所以现在不再叫网页制作,而是叫Web前端开发。Web前端开发在产品开发环节中的作用变得越来越重要,而且需要专业的前端工程师才能做好,这方面的专业人才近两年来备受青睐。Web前端开发是一项很特殊的工作,涵盖的知识面非常广,既有具体的技术,又有抽象的理念。简单地说,它的主要职能就是把网站的界面更好地呈现给用户。
如何才能做得更好呢?
第一,必须掌握基本的Web前端开发技术,其中包括:CSS、HTML、DOM、BOM、Ajax、JavaScript等,在掌握这些技术的同时,还要清楚地了解它们在不同浏览器上的兼容情况、渲染原理和存在的Bug。
第二,在一名合格的前端工程师的知识结构中,网站性能优化、SEO和服务器端的基础知识也是必须掌握的。
第三,必须学会运用各种工具进行辅助开发。
第四,除了要掌握技术层面的知识,还要掌握理论层面的知识,包括代码的可维护性、组件的易用性、分层语义模板和浏览器分级支持,等等。
可见,看似简单的网页制作,如果要做得更好、更专业,真的是不简单。这就是前端开发的特点,也是让很多人困惑的原因。如此繁杂的知识体系让新手学习起来无从下手,对于老手来说,也时常不知道下一步该学什么。
目前市面上关于Web前端开发的书主要都是针对单一技术的,本书与这些书有着本质的区别。它主要想实现两个目标:第一,为不太有经验的Web前端开发工程师建立大局观,让他们真正了解和理解这个职业;第二,帮助有一定Web前端开发经验的工程师修炼内功,通过编写高质量的代码来提高前端代码的可维护性。这是很多前端开发工程师感兴趣的内容。
本书的前两章讨论了网站重构和团队合作,这是很有必要的。网站重构的目的仅仅是为了让网页更符合Web标准吗?不是!重构的本质应该是构建一个前端灵活的MVC框架,即HTML作为信息模型(Model),CSS控制样式(View),JavaScript负责调度数据和实现某种展现逻辑(Controller)。同时,代码需要具有很好的复用性和可维护性。这是高效率、高质量开发以及协作开发的基础。建立了这种大局观后,学习具体技术的思路就更清晰了。
代码质量是前端开发中应该重点考虑的问题之一。例如,实现一个网站界面可能会有无数种方案,但有些方案的维护成本会比较高,有些方案会存在性能问题,而有些方案则更易于维护,而且性能也比较好。这里的关键影响因素就是代码质量。CSS、HTML、JavaScript这三种前端开发语言的特点是不同的,对代码质量的要求也不同,但它们之间又有着千丝万缕的联系。本书中包含着很多开发的思想和经验,都是在长期的开发实践中积累下来的,不同水平的Web前端工程师都会从中获得启发。
张克军(著名Web前端开发工程师)
2010年4月

Specifications

Brand Jingdong book
Brand Origin China

Disclaimer

Product packaging, specifications and price are subject to change without notice. All information about the products on our website is provided for information purposes only. Please always read labels, warnings and directions provided with the product before use.

View Full Terms of Use
Add to favorites
{{ $isZh ? coupon.coupon_name_sub : coupon.coupon_ename_sub | formatCurrency }}
{{__("Buy Directly")}} {{ itemCurrency }}{{ item.directly_price }}
Quantity
{{ quantity }}
{{ instockMsg }}
{{ limitText }}
{{buttonTypePin == 3 ? __("Scan to view more PinGo") : __("Scan to start")}}
Sold by JD@CHINA
Ship to
{{ __("Ship to United States only") }}
Free shipping over 69
Genuine guarantee

Added to Cart

Keep Shopping

More to Consider

{{ item.brand_name }}

{{ item.item_name }}

{{ item.currency }}{{ item.market_price }}

{{ item.currency }}{{ item.unit_price }}

{{ item.currency }}{{ item.unit_price }}

Coupons

{{ coupon.coupon_name_new | formatCurrency }}
Clip Clipped Over
{{ getCouponDescStr(coupon) }}
{{ coupon.use_time_desc }}
Expires soon {{ formatTime(coupon.use_end_time) }}

Share this item with friends

Cancel

Yami Gift Card

Get this exclusive deal when paying with gift card

Terms and Conditions

Gift card deals are special offers for selected products;

The gift card deals will automatically be activated if a customer uses gift card balance at check out and the balance is sufficient to pay for the total price of the shopping cart products with gift card deals;

You will not be able to activate the gift card deals if you choose other payment methods besides gift card. The products will be purchased at their normal prices;

If your account balance is not enough to pay for the products with gift card deals, you can choose to reload your gift card balance by clicking on the Reload button at either shopping cart page or check out page;

Products that have gift card deals can be recognized by a special symbol showing 'GC Deal';

For any additional questions or concerns, please contact our customer service;

Yamibuy reserves the right of final interpretation.

Sold by Yami

Service Guarantee

Yami Free Shipping over $49
Yami Easy Returns
Yami Ships from United States

Shipping

  • United States

    Standard Shipping is $5.99 (Excluding Alaska & Hawaii). Free on orders of $49 or more.

    Local Express is $5.99 (Available in Parts of CA, NJ, MA & PA). Free on orders of $49 or more.

    2-Day Express (Includes Alaska & Hawaii) starts at $19.99.

Return Policy

Yami is committed to provide our customers with a peace of mind when purchasing from us. Most items shipped from Yamibuy.com can be returned within 30 days of receipt of shipment (For Food, Beverages, Snacks, Dry Goods, Health supplements, Fresh Grocery and Perishables Goods, within 7 days of receipt of shipment due to damages or quality issues; To ensure that every customer receives safe and high-quality products, we do not provide refunds or returns for beauty products once they have been opened or used, except in the case of quality issues; Some products may have different policies or requirements associated with them, please see below for products under special categories, or contact Yami Customer Service for further assistance).
Thank you for your understanding and support.

Learn More

Sold by Yami

Terms and Conditions of Yami E-Gift Card

If you choose “Redeem automatically” as your delivery method, your gift card balance will be reload automatically after your order has been processed successfully;

If you choose “Send to Email”as your delivery method, the card number and CVV will be sent to the email address automatically;

Any user can use the card number and CVV to redeem the gift card, please keep your gift card information safely. If you have any trouble receiving email, please contact Yami customer service;

Yami gift card can be used to purchase both Yami owned or Marketplace products;

Yami gift card will never expire;

Yami gift card balance does not have to be used up at once;

All rights reserved by Yami.

Return Policy

Gift card that has already been consumed is non-refundable.

Sold by JD@CHINA

Service Guarantee

Yami Free Shipping over $49
Yami Easy Returns
Yami Ships from United States

Shipping

  • United States

    Standard Shipping is $5.99 (Excluding Alaska & Hawaii). Free on orders of $49 or more.

    Local Express is $5.99 (Available in Parts of CA, NJ, MA & PA). Free on orders of $49 or more.

    2-Day Express (Includes Alaska & Hawaii) starts at $19.99.

Return Policy

You may return product within 30 days upon receiving the product. Items returned must be new in it's original packing, including the original invoice for the purchase. Customer return product at their own expense.

Sold by JD@CHINA

Service Guarantee

Yami Cross-store Free Shipping over $69
Yami 30-days Return

Yami-China FC

Yami has a consolidation warehouse in China which collects multiple sellers’ packages and combines to one order. Our Yami consolidation warehouse will directly ship the packages to your door. Cross-store free shipping over $69.

Return Policy

You may return products within 30 days upon receiving the products. Sellers take responsibilities for any wrong shipment or missing items. Packing needs to be unopened for any other than quality issues return. We promise to pack carefully, but because goods are taking long journey to destinations, simple damages to packaging may occur. Any damages not causing internal goods quality problems are not allowed to return. If you open the package and any quality problem is found, please contact customer service within three days after receipt of goods.

Shipping Information

Yami Consolidation Service Shipping Fee $9.99(Free shipping over $69)

Sellers in China will ship their orders within 1-2 business days once the order is placed. Packages are sent to our consolidation warehouse in China and combined there. Our Yami consolidation warehouse will directly ship the packages to you via UPS. The average time for UPS to ship from China to the United States is about 10 working days and it can be traced using the tracking number. Due to the pandemic, the delivery time may be delayed by about 5 days. The package needs to be signed by the guest. If the receipt is not signed, the customer shall bear the risk of loss of the package.

Sold by JD@CHINA

Service Guarantee

Free shipping over 69
Genuine guarantee

Shipping

Yami Consolidated Shipping $9.99(Free shipping over $69)


Seller will ship the orders within 1-2 business days. The logistics time limit is expected to be 7-15 working days. In case of customs clearance, the delivery time will be extended by 3-7 days. The final receipt date is subject to the information of the postal company.

Yami Points information

All items are excluding from any promotion or points events on Yamibuy.com

Return Policy

You may return product within 30 days upon receiving the product. Items returned must be new in it's original packing, including the original invoice for the purchase. Customer return product at their own expense.

Yami

Download the Yami App

Back Top

Recommended for You

About the brand

Jingdong book

为您推荐

Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折

Reviews{{'('+ commentList.posts_count + ')'}}

Have your say. Be the first to help other guests.

Write a review
{{ totalRating }} Write a review
  • {{i}} star

    {{i}} stars

    {{ parseInt(commentRatingList[i]) }}%

Yami Yami
{{ comment.user_name }}

{{ showTranslate(comment) }}Show Less

{{ strLimit(comment,800) }}Show more

Show Original

{{ comment.content }}

Yami
Show All

{{ formatTime(comment.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ comment.likes_count }} {{ comment.likes_count }} {{ comment.reply_count }} {{comment.in_user==uid ? __('Delete') : __('Report')}}
Yami Yami
{{ comment.user_name }}

{{ showTranslate(comment) }}Show Less

{{ strLimit(comment,800) }}Show more

Show Original

{{ comment.content }}

Yami
Show All

{{ formatTime(comment.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ comment.likes_count }} {{ comment.likes_count }} {{ comment.reply_count }} {{comment.in_user==uid ? __('Delete') : __('Report')}}

No related comment~

Review

Yami Yami

{{ showTranslate(commentDetails) }}Show Less

{{ strLimit(commentDetails,800) }}Show more

Show Original

{{ commentDetails.content }}

Yami
Show All

{{ formatTime(commentDetails.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ commentDetails.likes_count }} {{ commentDetails.likes_count }} {{ commentDetails.reply_count }} {{commentDetails.in_user==uid ? __('Delete') : __('Report')}}

Please write at least one word

Comments{{'(' + replyList.length + ')'}}

Yami Yami

{{ showTranslate(reply) }}Show Less

{{ strLimit(reply,800) }}Show more

Show Original

{{ reply.reply_content }}

{{ formatTime(reply.reply_in_dtm) }}

{{ reply.reply_likes_count }} {{ reply.reply_likes_count }} {{ reply.reply_reply_count }} {{reply.reply_in_user==uid ? __('Delete') : __('Report')}}

Please write at least one word

Cancel

That’s all the comments so far!

Write a review
How would you rate this item?

Please add your comment.

  • A nice nickname will make your comments more popular!
  • The nickname in your account will be changed to the same as here.
Thanks for your review
Our community rely on great reviews like yours to find the best of Asia.

Report

If you find this content inappropriate and think it should be removed from the Yami.com site, let us know please.

Cancel

Are you sure to delete your review?

Cancel

You’ve Recently Viewed

About the brand

Jingdong book