7 ms·
There could be a flag included in the HTTP response header (X-Batch-DOM) or a meta tag like <meta http-equiv="X-Batch-DOM" content="1">. The response header wou
by coderdude 11y ago
There could be a flag included in the HTTP response header (X-Batch-DOM) or a meta tag like <meta http-equiv="X-Batch-DOM" content="1">. The response header would be a better place for that flag since you can stick a meta tag at any point in your markup (even where it's incorrect to do so). The browser could choose to ignore the meta tag if any JS has executed or it could reload the page with the setting turned on. Not ideal. Anyway, if you feel completely sure that your code would not do anything like you've demonstrated then batching might work fine. Though this basically excludes the safe use of externally linked scripts that you can't control (analytics is one example).