Chapter 18. Using JavaScript and Client-Side Frameworks

JavaScript has become the key language for client-side development of web applications. It runs in all browsers on all platforms on all device types, and it delights users with the increased interactivity, responsiveness, animations, and native-like feel it allows us to produce. JavaScript is required for writing client applications for ASP.NET or any other web server platform (PHP, Ruby, Python, and so on) because it runs on the client—all clients. JavaScript even extends to mobile applications, including Windows Store (WinJS) and cross-platform apps built with Cordova (see Part VII, “Creating Mobile Apps”). It’s fair to say that if there is a Hypertext Transfer Protocol (HTTP) call involved, there is a good chance you’ll need JavaScript skills to write a portion of the user interface.

There was a time when web developers all but ignored JavaScript. These developers wrote a lot of code that ran on the server, spent time making things look nice with Hypertext Markup Language (HTML) and Cascading Style Sheets (CSS), but used JavaScript sparingly for two reasons. First, JavaScript seemed complex because it is a dynamic language (and not very object-oriented). Second, the implementation of JavaScript to work with an HTML document object model (DOM) was different across browsers. This meant writing code for one browser and then fallback code to support other browsers and older versions. This was too much work. However, it resulted in the rise of JavaScript client frameworks.

JavaScript client frameworks ease the burden of writing cross-browser compliant JavaScript. They unlock the power of the ubiquitous nature of the language. These frameworks (such as the popular jQuery) make it easy to work with the DOM for partial-page updates, animations, touch, responsive design based on screen size, client-side data interactivity, and similar. These frameworks continue to evolve and make developers more productive.

This chapter is not as much about Microsoft Visual Studio features as it is about using Visual Studio to write client-side code. Our intent is to give Visual Studio web developers a foundation for using these technologies in their applications to delight their users.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset