This is a question looking for an approach / solution in order to solve the following requirement:
- You have a website running jQuery
- All jQuery functions on your site can be grouped into two groups: a) Business relevant logic (local functions, like navigation, etc.) and b) functions for fetching less important content (like advertisements), we call a) GROUP L and the other GROUP E (for external).
- The aim is to make sure that delays in group E do not hinder group L to execute, so group L and E should run in parallel, not impacting each other.
How can this be achieved?
Very simple example:
Local GROUP L :
<script>
$(document).ready(function() {
... local functions, e.g. event listeners for your local navigation ...
}
</script>
GROUP E: any javascript provided by external parties
<script>
$(document).ready(function() {
... external java script code, e.g. Advertiser JS-snippets ...
}
</script>