JavaScript Bible, Gold Edition part 196

JavaScript Bible, Gold Edition part 196. 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-442 Part VI Appendixes Listing 19-11 continued i BEGIN UNDO BUFFER CODE buffer global variables var newRanges new Array var origSearchString store original search string and bookmarks of each replaced range function pushUndoNew rng srchString replString origSearchString srchString character newRanges empty array and search string global function clearUndoBuffer 0 origSearchString 0 perform the undo function undoReplace if origSearchString for var i 0 i i newRanges i origSearchString i clearUndoBuffer SCRIPT HEAD BODY H1 Method H1 HR FORM P Enter a string to search for in the following text INPUT TYPE text NAME searchString SIZE 20 VALUE Law nbsp INPUT TYPE checkbox NAME caseSensitive Case-sensitive nbsp INPUT TYPE checkbox NAME wholeWord Whole words only P P Enter a string with which to replace found text INPUT TYPE text NAME replaceString SIZE 20 VALUE legislation P P INPUT TYPE button VALUE Search and Replace with prompt onClick sAndR P P INPUT TYPE button VALUE Search Replace and Count no prompt onClick sAndRCount Appendix F Examples from Parts III and IV CD-443 SPAN ID counter Q SPAN items found and replaced. P P INPUT TYPE button VALUE Undo Search and Replace onClick undoReplace P FORM DIV ID rights A NAME article1 H2 ARTICLE I H2 A P Congress shall make no law respecting an establishment of religion or prohibiting the free exercise thereof or abridging the freedom of speech or of the press or the right of the people peaceably to assemble and to petition the government for a redress of grievances. P The rest of the text is snipped for printing here but it is on the CD-ROM version. DIV BODY HTML Having a search and replace function available in a document is only .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
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.