Week of study, this week's biggest harvest is JS in the use of JSON format and abstract ideas, such as:
var book=[{id:1,bookname: "Software Development", Writer: "Tom", type: "Programming Technology", Time: "1999-2-30", Price:50,picture: "A.jpg"},
{id:2,bookname: "HTml", Writer: "Wersmith", type: "Programming Technology", Time: "1999-7-20", Price:80,picture: "B.jpg"},
{id:9,bookname: "Journey to the Monkey", Writer: "Luo Guan zhong", type: "Novel", Time: "2009-10-10", Price:10,picture: "F.jpg"}]
This is the use of a JSON format, as well as abstract ideas, encapsulation can be reused code, packaging it into a function, not only can reduce the amount of code written, avoid code redundancy, but also can greatly improve efficiency, such as simple to find object code can be encapsulated into a function, as follows:
function $ (Nid) {
return document.getElementById (Nid);
}
JSON format and abstract thinking