MyBB Community Forums

Full Version: Javascript functions loading last?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This has always been a bit annoying, but I just now figured I'd mention it.

If I'm viewing a large page with a lot of images or something like that and I just hit "Stop" to stop the images from loading and just read the text, the javascript functions don't work. No Quick Edit, no Inline Moderation, nothing. They just don't do anything at all if you try to use them.

Why is this? Shouldn't the page functions load first, before everything else? I'm on dial-up and sometimes it sucks to have to wait for the entire page to finish loading before I can use quick edit or moderation tools.
Some of the Javascript requires the HTML of the page to be loaded before the Javascript can be run (or else Javascript will complain about stuff not being there).
Ok, that's fine, but why does it require every image, youtube vid preview, etc. to be loaded as well? What I'm talking about is when everything on the page IS loaded, except for the extemporaneous stuff added by users, if I stop the page loading then, javascript functions still don't work.

Perfect example. Just now I tried to edit this post to fix a typo. Like a dummy, I didn't wait for the load to finish. I clicked quick edit and page stopped loading, but nothing else happened. I checked the page and, sure enough, the only thing NOT loaded was your (Dennis') sig picture. WHY does your sig pic have to load before I can quick edit???
Galen Wrote:Ok, that's fine, but why does it require every image, youtube vid preview, etc. to be loaded as well? What I'm talking about is when everything on the page IS loaded, except for the extemporaneous stuff added by users, if I stop the page loading then, javascript functions still don't work.

Perfect example. Just now I tried to edit this post to fix a typo. Like a dummy, I didn't wait for the load to finish. I clicked quick edit and page stopped loading, but nothing else happened. I checked the page and, sure enough, the only thing NOT loaded was your (Dennis') sig picture. WHY does your sig pic have to load before I can quick edit???

Because thats how it works. Learn programming and you'll understand too. Can't think of a better way to explain it
I guess it also depends on your browser. I just tried quick-editing with Opera after stopping the page load mid-way and it worked.

As with inline moderation, it is loaded when the browser says the rest of the page has completely loaded. It really depends on when the browser says the page is loaded.

Have you tried a different browser? Also you can disable avatars and signatures from being shown if you want the pages to load faster.
So it's a browser issue? Ok. Thank you for a useful answer, Dennis.
It depends on the browser, and on the script partially I guess. Some scripts load right after the specific HTML element is loaded (ie. the Javascript for the edit button is loaded right after the edit image) but for the inline moderation, the script waits for the browser to say the page has done loading before the inline moderation initializes.