/ / Como carregar vários scripts sem colidir? - jquery, desempenho, src

Como faço para carregar vários scripts sem que eles colidam? - jquery, performance, src

Estou trabalhando em um site que precisa carregar vários scripts. No entanto, de vez em quando, um ou dois deles não carregam.

Existe uma maneira melhor de carregar scripts para uma página do que o que tenho abaixo? ( Vejo http://www.pushpinevents.com/alarm )

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Alarm of America</title>


<script  type="text/javascript" src="java/jquery-1.10.1.min.js"></script>

<script  type="text/javascript" src="java/jkmegamenu.js"></script>

<script  type="text/javascript">
jkmegamenu.definemenu("megaanchor0", "megamenu0", "mouseover");
jkmegamenu.definemenu("megaanchor2", "megamenu2", "mouseover");
jkmegamenu.definemenu("megaanchor3", "megamenu3", "mouseover");
jkmegamenu.definemenu("megaanchor4", "megamenu4", "mouseover");
</script>




<script  type="text/javascript" src="java/slides.js"></script>


<script  type="text/javascript" src="curvycorners.src.js"></script>





<script type="text/javascript">
$("#mainbanner").ready(function() {
$("#slides").slidesjs({
width: 842,
height: 325,
play: {
active: false,
// [boolean] Generate the play and stop buttons.
// You cannot use your own buttons. Sorry.
effect: "fade",
// [string] Can be either "slide" or "fade".
interval: 2000,
// [number] Time spent on each slide in milliseconds.
auto: true,
// [boolean] Start playing the slideshow on load.

pauseOnHover: true,
// [boolean] pause a playing slideshow on hover
restartDelay: 2500,
// [number] restart delay on inactive slideshow

},

navigation: false



});
});
</script>

<link href="style.css" rel="stylesheet" type="text/css" />

</head>

Respostas:

1 para resposta № 1

Você poderia dar uma olhada Require.js. É um carregador de arquivos e módulos que fornece estrutura e segurança para o carregamento de scripts.