TAILIEUCHUNG - JavaScript Bible, Gold Edition part 121

JavaScript Bible, Gold Edition part 121. This book will bring programmers and non-technical professionals, including casual programmers and scripters, painlessly up to speed on all aspects of mastering JavaScript. Key topics include programming fundamentals, JavaScript language elements and how to use them effectively, and how to easily and efficiently add powerful new functionality to HTML documents and Java applets. | 1048 Part IV JavaScript Core Language Reference An advantage of the with structure is that it can make heavily object-dependent statements easier to read and understand. Consider this long version of a function that requires multiple calls to the same object but different properties function seeColor form newColor .text return newColor Using the with structure you can shorten the long statement function seeColor form with newColor options selectedIndex .text return newColor When JavaScript encounters an otherwise unknown identifier inside a with statement it tries to build a reference out of the object specified as its parameter and that unknown identifier. You cannot however nest with statements that build on one another. For instance in the preceding example you cannot have a with colorsList nested inside a with form statement and expect JavaScript to create a reference to options out of the two object names. As clever as the with statement may seem be aware that it introduces some inherent performance penalties in your script because of the way the JavaScript interpreter must artificially generate references . You probably won t notice degradation with occasional use of this construction but if it s used inside a loop that must iterate many times processing speed will almost certainly be affected negatively. Labeled Statements NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 Compatibility Crafting multiple nested loops can sometimes be difficult when the final condition your script is looking for is met deep inside the nests. The problem is that the break or continue statement by itself has scope only to the nearest loop level. Therefore even if you break out of the inner loop the outer loop s continue to execute. If all you want to do is exit the function after the condition is met a simple return statement performs the same job as some other languages exit command. But if you also need some .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.