TAILIEUCHUNG - JavaScript Bible, Gold Edition part 188

JavaScript Bible, Gold Edition part 188. 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. | CD-362 Part VI Appendixes Now freeze the document object s properties with the following statement false If you try to add a new property such as the following you receive an error tra la Interestingly even though is turned off the first custom property is still accessible and modifiable. fgColor See alinkColor. fileCreatedDate fileModifiedDate fileSize NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 Compatibility Example Listing 18-4 dynamically generates several pieces of content relating to the creation and modification dates of the file as well as its size. More importantly the listing demonstrates how to turn a value returned by the file date properties into a genuine date object that can be used for date calculations. In the case of Listing 18-4 the calculation is the number of full days between the creation date and the day someone views the file. Notice that the dynamically generated content is added very simply via the innerText properties of carefully-located SPAN elements in the body content. Listing 18-4 Viewing File Dates HTML HEAD TITLE fileCreatedDate and fileModifiedDate Properties TITLE SCRIPT LANGUAGE JavaScript Appendix F Examples from Parts III and IV CD-363 function fillInBlanks var created var modified created modified var createdDate new Date created .getTime var today new Date .getTime var diff today - createdDate 1000 60 60 24 diff SCRIPT HEAD BODY onLoad fillInBlanks H1 fileCreatedDate and fileModifiedDate Properties H1 HR P This file SPAN ID size nbsp SPAN bytes was created on SPAN ID created nbsp SPAN and most recently modified on SPAN ID modified nbsp SPAN . P P It has been SPAN ID diff nbsp SPAN days since this file was created. P BODY HTML forms NN2 NN3 NN4 NN6 IE3 J1 .

TỪ KHÓA LIÊN QUAN
Đã 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.