OK, sorry I missundertoo then the iPhone point, my bad, I interpreted it as iPhone is super fast so nobody should forget to mention in any article the iPhone is the fastest phone and Intel i9s are the fastest CPUs.
I agree that we the developers should not forget that a lot of people have less powerful hardware.
I sometimes hit thus problem at work, say we offer feature X like uploading an image and you can crop that image and apply a filter, how should I add this feature but not have the code even load in the browser if you don't intend to use, is there a pure JS way to do it? AFAIK thee is no good way to load a script at runtime and get an even when the file is loaded and parsed.
Thanks, I use this techinque but I had issues with it in the past, I tried a few minutes now to find documentation to confirm if the onload guarantees the script is loaded and finished parsing/interpreting but I can't find it.
Your example code works in all the browsers I tested so maybe it was an issue ith th particular script I was testing, there are third party scripts like for embedding an image editor, those could also use this trick to load some dependencies.
Great. so I was wrong then, this should work with most third party scripts.
I agree that we the developers should not forget that a lot of people have less powerful hardware.
I sometimes hit thus problem at work, say we offer feature X like uploading an image and you can crop that image and apply a filter, how should I add this feature but not have the code even load in the browser if you don't intend to use, is there a pure JS way to do it? AFAIK thee is no good way to load a script at runtime and get an even when the file is loaded and parsed.