jQuery vs. Mootools und andere Frameworks

Von Michaelmilli0n

© jQuery.com – http://jquery.com/

jQuery vs MooToolsMooToolsjQueryMootoolsjQueryCommerceTomatoCart($)MooTools
<script type="text/javascript" src="other_lib.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
jQuery.noConflict();
</script>

Möglichkeit 1

<script type="text/javascript">
jQuery(document).ready(function(){
//Hier folgen, wie gewohnt die jQuery-Anweisungen
};
</script>

Möglichkeit 2


<script type="text/javascript" src="other_lib.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$.noConflict();
jQuery(document).ready(function($) {
// Hier folgt der jQuery-Code mit der $-Anweisung
});
// Hier folgt der Code anderer JavaScript Frameworks.
</script>

Möglichkeit 3


<script type="text/javascript" src="other_lib.js"></script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
var $j = jQuery.noConflict();
$j(document).ready(function(){
//Hier folgen, wie gewohnt die jQuery-Anweisungen.
};
</script>

Google+

Michael Brückner