32\u590d\u4e60.docx - Week7 Client side javascript framework 1 Single page applications Allow full functionality to be in one page Html css js loaded on the
32u590du4e60.docx - Week7 Client side javascript...
100%(4)4 out of 4 people found this document helpful
This preview shows page 1 - 3 out of 4 pages.
Week7 Client side javascript framework1. Single page applicationsAllow full functionality to be in one page.Html, css, js loaded on the first page loadAjax technic is used to dynamically interact with the server. Retrieves data from server side User interface control moved from server side to client side2. Angular Js featuresBi-directional data binding, from view to model and from model to view.Html as template languages for viewsUI is based on and controlled by browser at client side3. Components of Angular Js applicationng-model: binds the value of Angular js application data to HTML inputcontrolsng-app: defines and link angular js application to htmlng-bind: binds the Angular js application data to html tagsWeek 8 :Validation, login, and usability featuresValidation can reduce security issues, minimize. Eg, code injection In models:Annotation:[Required(ErrorMessage = “”)][Range(0,100,ErrorMessage=””)][DataType(DataType.Date)][StringLength(255,MinimumLength = 8)][EmailAddress][RegularExpression(@"^\$?\d+(\.(\d{2}))?$")]In views:Through @Html.ValidationMessageFor(model=> model.Name,’’,)A customized Error Message can also be given in the view , through overriddenmethods eg. 三个参数,第一个朗目达,第二个error message第三个新html属性还有validation summary Usability Features:Tooltip, using title attributes.tabIndex and user input , using tabindex attributesrelevant hot keys, using accesskey attributes.Login and register :Annotate the Contact Action in the HomeController with "[Authorize]" annotation.Now you will need to be logged in to view the contact information.Week 9: web optimizations:Q: Describe 5 ways of optimizations in web application development and useexamples to illustrate your answers.A: Mainly: 1. Reduce http connect 2. Reduce file size3. Caching 4. perceived improvementDetailed: 1. combine images, making JS asynchronous and reduce size of files.2. Image optimization: use css to replace small icons to reduce http request. Use
image compression to choose the correct type corresponding to img size3. Minify Css and JavaScript: remove white space and break line. Use min file.