Script.aculo.us: Difference between revisions

Content deleted Content added
Usage: WP:NOTHOWTO / user manual; trivia in encyclopedia context
Tag: section blanking
Line 86:
</div>
</div>
</source>
 
==Usage==
 
Incorporating script.aculo.us into a website requires copying all JavaScript files in a folder and the following lines inserted in the head of an [[HTML]] document:
 
<source lang="html4strict">
<script src="javascripts/prototype.js" type="text/javascript"></script>
<script src="javascripts/scriptaculous.js" type="text/javascript"></script>
</source>
 
These lines must be loaded first before any JavaScript requesting any Prototype or script.aculo.us functions. Once loaded, these functions can be called in any valid JavaScript ___location including script tags and event handlers.
 
An alternative to copying all JavaScript files and hosting them locally to a website, Google provides an [http://code.google.com/apis/ajaxlibs/ Ajax Libraries API] that provides both Prototype and script.aculo.us which can be accessed using the Ajax API or directly as above:
 
<source lang="html4strict">
<script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.3/prototype.js" type="text/javascript">
</script>
<script src="http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.2/scriptaculous.js" type="text/javascript">
</script>
</source>