Book Image

PhoneGap Beginners Guide (third edition)

Book Image

PhoneGap Beginners Guide (third edition)

Overview of this book

Table of Contents (22 chapters)
PhoneGap Beginner's Guide Third Edition
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Related Plugin Resources
Index

Using template engine compression


When you work on larger HTML projects, it's advisable to use JavaScript templating engines and image compressions. When the application needs to be updated frequently with data, templating libraries will be of much use. I strongly believe that there is no such thing as the best JavaScript template engine. Each time you work on a project, you have to decide which is the right engine for the job at hand. For instance, Underscore.js templates are fast and lightweight and if you want them already loaded in your app, then it's a good option. When using jQuery, the natural choice seems to be ICanHaz.js because it returns each template as a jQuery object. When you need a more robust template engine, then Google Closure Templates could be a valid option. For a comparison of templating engines, visit http://garann.github.io/template-chooser/.

In most cases, Mustache.js completely fits the needs of an application because there is no logic in the templates and because...