A: This book is brought into the knowledge point by several cases, easy to understand. The greatest gains are the gradual increase and steady degradation that the authors have repeatedly mentioned.
"Progressive enhancement" refers to the same basic usage experience as the user, and gives more advanced users a more efficient and easy user experience based on the level of the user terminal. "Smooth degradation" is equally a benchmark for all users, but in the opposite direction of progressive enhancement, this approach is to deprive low-level users of some experience.
Two: Solve some browser incompatibility HTML5, CSS3 problem
Use Modernizr to resolve
Https://modernizr.com/download?setclasses
Three: Methods
Loading functions, complex code is more convenient with this method
// methods of loading functions, such as addloadevent (functionname), are equivalent to Window.onload function Addloadevent (func) { var oldonload = window.onload; if (typeof window.onload! = ' function ') {= func ; Else { function() { oldonload (); Func (); }}}
functionloadevents () {//Homeprepareslideshow (); // AboutPrepareinternalnav (); //PhotosPrepareplaceholder (); Preparegallery (); //LiveStripetables (); Highlightrows (); Displayabbreviations (); // Contactfocuslabels (); Prepareforms ();}//Load Eventsaddloadevent (highlightpage); addloadevent (loadevents);
InsertAfter () method does not exist in H5
// Insert before an element node function InsertAfter (newelement,targetelement) { var parent = Targetelement.parentnode; if (Parent.lastchild = = targetelement) { parent.appendchild (newelement) ; Else { parent.insertbefore (newelement,targetelement.nextsibling); }}
Append class
// method of appending class function addclass (element,value) { if (! Element.classname) { = value; Else { = element.classname; Newclassname+ = ""; Newclassname+ = value ; = newclassname; }}
"JavaScript DOM Programming Art" notes