title: Call an aui:script function in JavaScript or convert aui:script code in JavaScript code
body: <p>I need to call in JavaScript one of the two <code>aui:script</code> functions from the source code below, or to convert this <code>aui:script</code> source code in JavaScript code (in this way it would be easier for me).</p>
  
  <pre><code>&lt;c:if test="&lt;%= portletDisplay.isShowConfigurationIcon() %&gt;"&gt;
      &lt;aui:script use="aui-editable,aui-io-request"&gt;
          var i = A.one('#theId').get('value');
          for(var j=1;j&lt;=i;j++) 
          { 
           addElement('&lt;%=portletDisplay.getURLClose()%&gt;','&lt;%= themeDisplay.getPathThemeImages() %&gt;','&lt;%= color %&gt;','&lt;%= StringUtil.replace(HtmlUtil.escape(data), "&amp;lt;br /&amp;gt;", "&lt;br /&gt;") %&gt;');
          }   
          var quickNotePad = A.one('#&lt;portlet:namespace /&gt;pad'+0);
          alert('#&lt;portlet:namespace /&gt;pad'+0);
  
  
          if (quickNotePad) {
              quickNotePad.all('.note-color').on(
                  'click',
                  function(event) {
                      var box = event.currentTarget;
  
                      var bgColor = box.getStyle('backgroundColor');
  
                      quickNotePad.setStyle('backgroundColor', bgColor);
  
                      A.io.request(
                          '&lt;%= themeDisplay.getPathMain() %&gt;/quick_note/save',
                          {
                              data: {
                                  color: bgColor,
                                  p_auth: Liferay.authToken,
                                  p_l_id: '&lt;%= plid %&gt;',
                                  portletId: '&lt;%= portletDisplay.getId() %&gt;'
                              }
                          }
                      );
                  }
              );
          }
  
  
          new A.Editable(
              {
                  inputType: 'textarea',
                  node: '#&lt;portlet:namespace /&gt;note'+0,
                  on: {
                      contentTextChange: function(event) {
                          var instance = this;
  
                          if (!event.initial) {
                              var newValue = event.newVal.replace(/\n/gi, '&lt;br /&gt;');
  
                          alert('#&lt;portlet:namespace /&gt;note'+0);
  
                              event.newVal = instance._toText(event.newVal);
  
                              A.io.request(
                                  '&lt;%= themeDisplay.getPathMain() %&gt;/quick_note/save',
                                  {
                                      data: {
                                          data: newValue,
                                          p_auth: '&lt;%= AuthTokenUtil.getToken(request) %&gt;',
                                          p_l_id: '&lt;%= plid %&gt;',
                                          portletId: '&lt;%= portletDisplay.getId() %&gt;'
                                      }
                                  }
                              );
                          }
                      }
                  }
              }
          );
  
      &lt;/aui:script&gt;
  &lt;/c:if&gt;
  </code></pre>
  
  <p>Could anyone give me an idea, please? I've already tried to do it in some ways, but it doesn't work... Thanks.</p>