Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 546 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
546
Dung lượng
5,24 MB
Nội dung
[...]... client-side JavaScript toolkit, and its heart lies in some welltuned JavaScript scripts In a Dojo-based web application, you create small bits of HTML and JavaScript that call the Dojo toolkit code Technically, Dojo doesn’t need a web server You can install Dojo into any directory, build Dojo-based web applications, and load them all 21 A DDING D OJO AND D IJIT TO A P AGE with the file:// protocol But a web. .. When we’re done, you’ll have a form that’s so neat and functional that you’ll want to tape a copy of it to your refrigerator Dijit components solve common web design issues, and you can drop them in and make them work in a matter of minutes And that’s good, because you have a problem form on your hands 2.1 What Customers Are Saying About Your Form So, let’s talk about that web page You know the one It’s... tooltips, and progress bars There are widgets to model complex data such as hierarchical trees and tables Dijit comes with more than forty prepackaged widgets, and many work well without a stitch of extra JavaScript! W HAT C USTOMERS A RE S AYING A BOUT Y OUR F ORM In this chapter, we will take a traditional fill -and- submit form and turn it into a more functional, intuitive, and feature-rich form We’ll... Altogether, it includes about fifty JavaScript scripts and several other resources that handle browser normalization, JavaScript modularization, extensions to the core JavaScript library, extensions to the W3C DOM API (including a parsing and querying the DOM), remote scripting, Firebug Lite, drag and drop, a data store API, 14 U SING THE B OOK localization and internationalization, and a few other miscellaneous... about JavaScript and DOM programming by Douglas Crockford.5 • The canonical JavaScript reference is JavaScript: The Definitive Guide [Fla06] It also includes a very good DOM tutorial and reference • CSS is often arcane and obtuse Cascading Style Sheets: The Definitive Guide [Mey06] makes a good attempt, but there are several other references with different strengths and weaknesses • On the other hand,... thanks to them I’d like to thank the contributors and committers who have made Dojo the outstanding achievement that it is They have given their time and astonishing efforts to the project without any expectation of material reward, and I am lucky to lead and work in such a team Their boundless optimism, perseverance, and dedication have pushed the open Web forward in ways that many often wrote off as impractical... It looks and works great! Click a tab, and the data pops out in front The Tundra theme makes the design elements look good It acts like you’d expect What would have taken you hours to code in JavaScript takes just a few tags and two JavaScript statements Something Wrong? Things happen The most common novice problem is seeing no formatting appear so that our form looks more like the form we started... required, and if you leave it off, the tabs will not appear at all (Consider yourself warned!) The width, on the other hand, is optional So, let’s get this party started! Download the code, and place it into a new directory called dojobook/advanced_forms_made_easy Fire up your favorite browser, and hit the URL http://yourserver/dojobook/advanced_ forms_made_easy/form_with_dijit.html Up pops your tabbed form,... the time to read and critique the manuscript Nearly every page includes improvements recommended by these experts Finally, a tip of the hat to the folks at Pragmatic Programmers—clearly a publisher by programmers for programmers Thanks for giving us the opportunity and all of the support along the way —Rawld, Craig, and Alex I would like to especially thank my coauthors, Craig and Alex, and the development... take a look at your new tabbed form It cuts a very fine figure, indeed! And easy to use? Absolutely! And this is only the beginning 2.5 Improved Form Controls Getting back to our problem form, one issue concerns bad data A little behavioral psychology on the user will help: make the good choices easy to pick and the bad choices difficult Unfortunately, HTML controls go for the lowest common denominator, . class="bi x0 y0 w0 h0" alt="" Masterin g Dojo JavaScript and Ajax Tool s for Great Web Experiences Rawld Gill Craig Riecke Alex Russell The Pragmatic Bookshelf Raleigh, North Carolina Dallas, Texas this. letters or in all capitals. The Pragmatic Sta rter Kit, The Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking g device are trademarks of The Pragmatic Programmers, LLC. The. an other major force behind Dojo’s philosophy and content. If the browsers were standards-compliant (or, at least compatible), if JavaScript and the DOM API fixed some glaring shortcomings, and if HTML