Taking Your Talent to the Web- P22

Taking Your Talent to the Web- P22:It was a simple solution to a complex problem. On one side, thousands of designers and art directors are eager to take their talents to the Web but aren’t sure how. On the other, web agencies could not find enough good web designers to get their work done. | 296 HOW The Joy of JavaScript The Dreaded Text Rollover What is going on here We ve used the onMouseOver event handler to tell the browser that something is supposed to happen when the visitor s mouse hovers over this link. The event handler is followed by the equal sign in the same way that links and other standard bits of HTML use the equal sign. As you may have guessed is JavaScript s charming way of referring to the status bar at the bottom of the web page. The status bar is the part of the browser that usually displays the bare-naked URL generally at the lower left. Without getting too hairy JavaScript gives each object in its document model an address based on the object s position within the document s hierarchy moving from the top level of the hierarchy down to the details window is a top-level object status is the object being modified via JavaScript. Like we said buy the JavaScript books if you want a better explanation and you probably do. Notice that the status bar message text FASHION MAVEN fashions for men. is enclosed within single quotation marks. This is because the JavaScript itself is enclosed within double quotation marks. If the text also used double quotation marks the browser would not know how to distinguish the quoted JavaScript from the quoted text. Observe also that both the description and the phrase return true end in a semicolon. This is basic JavaScript syntax so get used to it. There are more semicolons in JavaScript than in all Charles Dickens s novels combined. Technically the semicolon is not required when a JavaScript statement ends the line. So some thing is perfectly valid JavaScript in the context of a function a la script type text javascript function rollover some thing no semicolon script But if you are placing two or more statements on a single line as you would inside an event handler attribute you must separate the statements by semicolons. Taking Your Talent to the Web 297 .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.