I think loading indicators fall into two categories:
1. full page
2. unobtrusive
Those 1px progress bars are unobtrusive because you can partially render data you've already received while still conveying that more data is loading.
To make a JS progress bar correctly show precent of data loaded over a network you would need to first know the total data size. That's why JS progress bars are always auto-incrementing and don't represent actual loading progress.