tailieunhanh - JavaScript Bible, Gold Edition part 212
JavaScript Bible, Gold Edition part 212. 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-602 Part VI Appendixes Listing 34-2 Character Conversions HTML HEAD TITLE Character Codes TITLE SCRIPT LANGUAGE JavaScript var isNav Netscape var isNav4 isNav parseInt 4 function showCharCode if isNav var theText else var theText .text if theText 0 . else 0 . function showString form if isNav4 showCharCode SCRIPT HEAD BODY B Capturing Character Codes B FORM Select any of this text and see the character code of the first character. P Character Code INPUT TYPE text NAME charCodeDisplay SIZE 3 BR HR B Converting Codes to Characters B BR Enter a value 0-255 INPUT TYPE text NAME entry1 SIZE 4 BR Enter a value 0-255 INPUT TYPE text NAME entry2 SIZE 4 BR Enter a value 0-255 INPUT TYPE text NAME entry3 SIZE 4 BR INPUT TYPE button VALUE Show String onClick showString Result INPUT TYPE text NAME result SIZE 5 FORM BODY HTML Appendix F Examples from Parts III and IV CD-603 searchString startindex NN2 NN3 NN4 NN6 IE3 J1 IE3 J2 IE4 IE5 Compatibility Example Enter each of the following statements up to but not including the comment symbols into the top text box of The Evaluator you can simply replace the parameters of the indexOf method for each statement after the first one . Compare your results with the results shown below. a bananas b result 0 a result 1 a 1 result 1 a 2 result 3 a 4 result 5 nan result 2 nas result 4 s result 6 z result - index of first letter is zero start from second letter start from third letter start from fifth letter 1 no z in string searchString startindex NN2 .
đang nạp các trang xem trước