Home > Articles > Open Source > Ajax & JavaScript

This chapter is from the book

This chapter is from the book

Getting the Screen Size

An important feature of JavaScript these days is the ability to get the screen size. The screen sizes of browsers vary so much that you often need to use different sets of code for larger, medium, or smaller screens. To get the screen size, use the screen.availHeight and screen.availWidth attributes. These values are specified in the number of pixels.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.