Skocz do zawartości

Aktywacja nowych użytkowników
Zakazane produkcje

  • Ostatnio przeglądający   0 użytkowników

    Brak zarejestrowanych użytkowników przeglądających tę stronę.

Alexandr

Tutsplus - Next Generation JavaScript with AMD and RequireJS

Rekomendowane odpowiedzi

5id80FY5X7C7nqqR1xK80u27WZirfFEl.jpg

 

Tutsplus - Next Generation JavaScript with AMD and RequireJS

English | .MOV | aac, 44100 Hz, stereo | h264, yuv420p, 1280x800, 30.00 fps | 299 Mb

Genre: eLearning

 

 

There are a couple of issues with this method.

 

Firstly, it's just plain inconvenient. All the JavaScript in all the scripts is loaded into the global "namespace." Of course, this may be misleading to beginners, who could easily-and excusable-think that identically-named variables in different files won't conflict. But more than that, it's a pain for experienced JavaScript developers with perhaps dozens of JavaScript files. Some files will depend on others, which may depend on others, etc. And you're on playground duty: you've got to make sure they all arrive in the right order, and that nobody clobbers anybody. This can be both tricky or time-consuming, depending on the project.

 

Secondly-and more importantly-when a browser is downloading and executing JavaScript files, that's all it's doing; it's blocking the downloading of other content until that's done. This is why you've heard it recommended to put your tags at the end of your , instead of in your as used to be the idea: that way, all your other content (HTML, CSS, images, etc.) will be visible to the user before the JavaScript is downloaded and executed. By using one of the many script loaders available, you'll be able optimize this process at much as possible. RequireJS is one of those loaders, and you'll get all the benefits of using it with AMD. For more on this, read the first chapter (and of course all the rest!) of High Performance JavaScript by Nicolas C. Zakas.

DOWNLOAD

 

Ukryta Zawartość

    Treść widoczna tylko dla użytkowników forum DarkSiders. Zaloguj się lub załóż darmowe konto na forum aby uzyskać dostęp bez limitów.

Ukryta Zawartość

    Treść widoczna tylko dla użytkowników forum DarkSiders. Zaloguj się lub załóż darmowe konto na forum aby uzyskać dostęp bez limitów.

Ukryta Zawartość

    Treść widoczna tylko dla użytkowników forum DarkSiders. Zaloguj się lub załóż darmowe konto na forum aby uzyskać dostęp bez limitów.

Ukryta Zawartość

    Treść widoczna tylko dla użytkowników forum DarkSiders. Zaloguj się lub załóż darmowe konto na forum aby uzyskać dostęp bez limitów.

Udostępnij tę odpowiedź


Odnośnik do odpowiedzi
Udostępnij na innych stronach

Dołącz do dyskusji

Możesz dodać zawartość już teraz a zarejestrować się później. Jeśli posiadasz już konto, zaloguj się aby dodać zawartość za jego pomocą.

Gość
Dodaj odpowiedź do tematu...

×   Wklejono zawartość z formatowaniem.   Usuń formatowanie

  Dozwolonych jest tylko 75 emoji.

×   Odnośnik został automatycznie osadzony.   Przywróć wyświetlanie jako odnośnik

×   Przywrócono poprzednią zawartość.   Wyczyść edytor

×   Nie możesz bezpośrednio wkleić grafiki. Dodaj lub załącz grafiki z adresu URL.

    • 1 Posts
    • 221 Views
    • 1 Posts
    • 282 Views
    • 1 Posts
    • 409 Views
    • 1 Posts
    • 247 Views
    • 1 Posts
    • 311 Views

×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Korzystając z tej witryny, wyrażasz zgodę na nasze Warunki użytkowania.