<aui:script>
tag outputs
AUI().use(function(A) {
}
only if you provide dependencies via use
attribute. Like
<aui:script use="aui-base">
// your code here
</aui:script>
If you do so, you'll have
<script type="text/javascript">
AUI().use('aui-base', function(A) {
// your code here
}
</script>
as a result. But in this case, all functions you declare inside will not be global. To make them global call
Liferay.provide(window, 'functionName', function() {
// function body
});
inside <aui:script/>
Also <aui:script use="aui-base"/>
is better than manually calling AUI().use(function(A) {})
if client can have IE <= 7, that doesn't work correctly with AUI().use()
. In case of IE 6,7 <aui:script use="aui-base>
will output AUI().ready('aui-base', function(A) {});
which will work in old browsers.