Abstract
While JavaScript now plays a far more significant role in web applications, the HTML5 specification (and therefore modern browsers) does not specify a means to detect dependency relationships among scripts, or how to load script dependencies in a particular order. In the simplest scenario, scripts are typically referenced in page markup with simple <script> tags. These tags are evaluated, loaded, and executed in order, which means that common libraries or modules are typically included first, then application scripts follow. (For example, a page might load jQuery and then load an application script that uses jQuery to manipulate the Document Object Model [DOM].) Simple web pages with easily traceable dependency hierarchies fit well into this model, but as the complexity of a web application increases, the number of application scripts will grow and the web of dependencies may become difficult, if not impossible, to manage.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2015 Tim Ambler and Nicholas Cloud
About this chapter
Cite this chapter
Ambler, T., Cloud, N. (2015). RequireJS. In: JavaScript Frameworks for Modern Web Dev. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-0662-1_5
Download citation
DOI: https://doi.org/10.1007/978-1-4842-0662-1_5
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-0663-8
Online ISBN: 978-1-4842-0662-1
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books