With renowned JavaScript expert Danny Goodman at your side, you’ll get a thorough grounding in JavaScript basics, see how it fits with current Web browsers, and find all the soup-to-n[r]
Trang 2JavaScript ®
Bible
Sixth Edition
Danny Goodman with Michael Morrison
With a foreword by Brendan Eich, JavaScript’s creator
Trang 3With renowned JavaScript expert Danny Goodman
at your side, you’ll get a thorough grounding in
JavaScript basics, see how it fits with current Web
browsers, and find all the soup-to-nuts detail you’ll
need, whether you’re a veteran programmer or just
starting out This is the JavaScript book Web developers
turn to again and again.
Shelving Category:
COMPUTERS/Internet/
Web Site Design
Reader Level:
Beginning to Advanced
$49.99 USA
$59.99 Canada
£31.99 UK
ISBN 978-0-470-06916-5
www.wiley.com/compbooks
• Master JavaScript fundamentals and write your first practical script
• Develop code for both single- and cross-platform audiences and
evolving standards
• Get the essentials of document object models and HTML element objects
• Write scripts that dynamically modify Web pages in response to
user actions
• Learn the power of new Ajax technologies to create efficient Web
page user interfaces
• Apply the latest JavaScript exception handling and custom object techniques
• Create interactivity with sites like Google Maps™
Trang 4Praise for Danny Goodman’s JavaScript ®Bible
“JavaScript ® Bible is the definitive resource in JavaScript programming I am never more than three feet
from my copy.”
—Steve Reich, CEO, PageCoders
“This book is a must-have for any web developer or programmer.”
—Thoma Lile, President, Kanis Technologies, Inc
“Outstanding book I would recommend this book to anyone interested in learning to develop advanced Web sites Mr Goodman did an excellent job of organizing this book and writing it so that even a begin-ning programmer can understand it.”
—Jason Hensley, Director of Internet Services, NetVoice, Inc
“Goodman is always great at delivering clear and concise technical books!”
—Dwayne King, Chief Technology Officer, White Horse
“JavaScript ® Bible is well worth the money spent!”
—Yen C.Y Leong, IT Director, Moo Mooltimedia, a member of SmartTransact Group
“A must-have book for any internet developer.”
—Uri Fremder, Senior Consultant, TopTier Software
“I love this book! I use it all the time, and it always delivers It’s the only JavaScript book I use!”
—Jason Badger, Web Developer
“Whether you are a professional or a beginner, this is a great book to get.”
—Brant Mutch, Web Application Developer, Wells Fargo Card Services, Inc
“I never thought I’d ever teach programming before reading your book [JavaScript ® Bible] It’s so simple to
use—the Programming Fundamentals section brought it all back! Thank you for such a wonderful book, and for breaking through my programming block!”
—Susan Sann Mahon, Certified Lotus Instructor, TechNet Training
“Danny Goodman is very good at leading the reader into the subject JavaScript ® Bible has everything we
could possibly need.”
—Philip Gurdon
“An excellent book that builds solidly from whatever level the reader is at A book that is both witty and educational.”
—Dave Vane
“I continue to use the book on a daily basis and would be lost without it.”
—Mike Warner, Founder, Oak Place Productions
“JavaScript ® Bible is by far the best JavaScript resource I’ve ever seen (and I’ve seen quite a few).”
—Robert J Mirro, Independent Consultant, RJM Consulting
Trang 6window.prompt()method, using, 86–87
windows
adjusting height and width of, 394–396
arranging in authoring environment, 19
controlling appearance of, 430
creating, 83–85, 436–437
generating with newWindow()function, 127
loading content into, 435–436
loading documents into, 430
references for, 126–128
repositioning onscreen, 427–430
resizing, 441–442, 469
sizing to content, 465
Windows 32-bit operating systems, using Internet Explorer
with, 173 Windows authoring environment, setting up, 19
Windows Media Player (WMP), relationship to
geckoAciveXObject() methods, 425 Winhelp window, opening, 453
WinIE, plug-in detection in, BC183–BC186
WinIE Objectsglobal statement, explanation of, 1073
WinIE Script Debugger, features of, BC335
WinIE4+, keyboard event tasks in, 351–355
WinIE5.5+, filter syntax changes in, 861–865
withstatement
explanation of, 982–983
using with Mathobject, 921–922
WMP (Windows Media Player), relationship to
geckoAciveXObject() methods, 425
wordBreakproperty, explanation of, 837
wordSpacingproperty, explanation of, 838
wordWrapproperty, explanation of, 838
workflow, establishing for authoring environment, 18
wrapproperty for textareaelement object, explanation
of, 710
write() method
of documentobject, 581–585
using document.write()method, 89
writeln() method for documentobject, explanation of,
581–585
writingModeproperty, explanation of, 838
WRONG_DOCUMENT_ERR exception, throwing, 991
X
x property
for IE4+ eventobject, 771–776
for img element object, 624
XHTML style, case requirements for, 23 XHTML validators, hiding scripts from, 148 XML data reading script code sample, 874 XML data transformation application constructing table for, BC508–BC510 converting data for, BC502–BC504 implementation plan for, BC500 initialization sequence for, BC501–BC502
select elements in, BC499 selecting controls for, BC510 sorting JavaScript database for, BC504–BC505 structure of, BC498
styleSheetobject for, BC500–BC501 XML data, transforming into viewable HTML, BC524–BC525 XML document, manipulating in Google Maps application,
BC523–BC524
xmlelement object explanation of, 869–870 properties for, 869 syntax for, 869 XML element objects, returning references to, 543 XML element reading, properties and methods for, 868–869 XML specification, relationship to AJAX outline, BC426 XML tags, associating namespace URIs with, 233
XMLDocumentproperty for xmlelement, explanation of,
870–871
xmlEncoding property for documentobject, explanation
of, 562
XMLHttpRequestobject event handlers for, 871 explanation of, 871–875 methods for, 871 properties for, 871 syntax for, 871
xmlStandalone property for documentobject,
explanation of, 562
xmlVersion property for documentobject, explanation
of, 562 XPath expressions, evaluating, 574
xRay()filter, description and properties for, 857, 865
Y
y property for IE4+ eventobject, 771–776 for img element object, explanation of, 624
1172
Index
W
Trang 7zero (0), avoiding with Dateobjects, 115
zero fill by value (>>=) assignment operator, example of, 1008
zero fill right shift (>>>) operator, operands for, 1014
zIndexpositioning property, explanation of, 845 zIndex values, relationships among, BC216–BC218
z-lockattribute of open()method, explanation of, 432
zoomproperty, explanation of, 843
1173