6
jQuery - più $ (documento). già ...?
Domanda: Se collego due file JavaScript, entrambi con $(document).readyfunzioni, cosa succede? Uno sovrascrive l'altro? O entrambi $(document).readyvengono chiamati? Per esempio, <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script> <script type="text/javascript" src="http://.../jquery1.js"></script> <script type="text/javascript" src="http://.../jquery2.js"></script> jquery1.js: $(document).ready(function(){ $("#page-title").html("Document-ready was called!"); }); jquery2.js: $(document).ready(function(){ $("#page-subtitle").html("Document-ready was called!"); }); Sono sicuro che è buona prassi combinare semplicemente entrambe …
359
javascript
jquery