What are the performance hit or implications, if any, of:
If I have multiple
<script>tags on one .aspx page?Declaring variables in
<script>tags of a .aspx page and calling these variables from an external .js file?
What are the performance hit or implications, if any, of:
If I have multiple <script> tags on one .aspx page?
Declaring variables in <script> tags of a .aspx page and calling these
variables from an external .js file?
There is really no inherent performance hit in running JavaScript on your page. Now, if it's a lot of really slow JavaScript, that's another story entirely. But the nature of just having it there isn't going to hurt anything.
Multiple <script> tags containing in-line javascript will not affect performance. Multiple <script> tags that load external javascript files will of course result in multiple requests; in this case it's better for performance to combine the external files into a single file.
Declaring variables within the page and referencing them outside is fine, although of course you need the declarations to be before the tags that load the external file. This is a common pattern for situations where you're getting the value for a javascript variable from server-side code.