Hello I need some quick help for a school project,

I need a script for the head of my HTMl file that examines the size of the browser window. If the browser is a certain size, then the HTML will load a external javascript. Is this possible?

Thank you