Organizational Research By

Surprising Reserch Topic

when should i use inline vs external javascript


when should i use inline vs external javascript  using -'javascript,html,performance,frontend'

I would like to know when I should include external scripts or write them inline with the html code, in terms of performance and ease of maintenance.

What is the general practice for this?

Real-world-scenario - I have several html pages that need client-side form validation. For this I use a jQuery plugin that I include on all these pages. But the question is, do I:


write the bits of code that configure this script inline?
include all bits in one file that's share among all these html pages?
include each bit in a separate external file, one for each html page?


Thanks.
    

asked Sep 22, 2015 by android_master
0 votes
32 views



Related Hot Questions

15 Answers

0 votes
NULL
answered Sep 22, 2015 by akhilesh
0 votes
NULL
answered Sep 22, 2015 by thiru
0 votes
NULL
answered Sep 22, 2015 by deven.bendale
0 votes
NULL
answered Sep 22, 2015 by virendra.bajaj
0 votes
NULL
answered Sep 22, 2015 by maurya
0 votes
NULL
answered Sep 22, 2015 by santosh soni
0 votes
NULL
answered Sep 22, 2015 by yogeshplv
0 votes
NULL
answered Sep 22, 2015 by pradip.bhoge
0 votes
NULL
answered Sep 22, 2015 by devkumargupta
0 votes
NULL
answered Sep 22, 2015 by dhananjayksharma
0 votes
NULL
answered Sep 22, 2015 by rajeshujade
0 votes
NULL
answered Sep 22, 2015 by suyesh.lokhande
0 votes
NULL
answered Sep 22, 2015 by mtabakade
0 votes
NULL
answered Sep 22, 2015 by suyesh.lokhande
0 votes
NULL
answered Sep 22, 2015 by bhavin

...