Javascript bible_ Chapter 26

Tham khảo sách 'javascript bible_ chapter 26', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | The String Object Chapter 6 s tutorial introduced you to the concepts of values and the types of values that JavaScript works with things such as strings numbers and Boolean values. In this chapter you look more closely at the very important String data type as well as its relationship to the Number data type. Along the way you encounter the many ways in which JavaScript enables scripters to manipulate strings. Much of the syntax you see in this chapter is identical to that of the Java programming language. Because the scope of JavaScript activity is narrower than that of Java there isn t nearly as much to learn for JavaScript as for Java. At the same time certain string object language features apply to scripting but not to Java programming. Improvements to the string object s methods in Navigator 4 greatly simplify a number of string manipulation tasks. If you must script for a lower common denominator of browser however you may need some of the same kind of string micro-management skills that a C programmer needs. I ll soften the blow by providing some general purpose functions that you can plug into your scripts to make those jobs easier. String and Number Data Types Although JavaScript is not what is known as a strongly typed language you still need to be aware of several data types because of their impact on the way you work with the information in those forms. In this section I focus on strings and two types of numbers. Simple strings A string consists of one or more standard text characters between matching quote marks. JavaScript is forgiving in one regard You can use single or double quotes as long as you match two single quotes or two double quotes around a string. Another benefit to this scheme becomes apparent when you try to include a quoted string inside a string. For example say that you re assembling a line of HTML code in a variable that you will eventually write to a new window In This Chapter How to parse and work with text Performing .

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.