Caricamento script Javascript

27 views
Skip to first unread message

Salvatore Picozzi

unread,
Jan 11, 2013, 10:13:45 AM1/11/13
to ent...@googlegroups.com
Seguendo la guida https://github.com/entando/Entando/wiki/Showlets-mini-howto ho creato uno script per limitare il numero di caratteri di una textarea, ma la mia jsp non carica lo script.
Quando devo caricare la texarea si verifica un errore, che allego.
Nella jsp inserisco questo codice:

<wp:headInfo type="JS" var="contatorecaratteri" />
        <script type="text/javascript" runat="server" src="<wp:resourceURL/>/js/contatorecaratteri.js"> 
        </script>

Poi lo uso in questa form:
                    <form method="post">
                              <table cellpadding="0" cellspacing="0" style="width: 200px">
                                  <tr>
                                      <td>
                                          <textarea name="testo" wrap="soft" onKeyUp="contatore(this.form)"></textarea>
                                      </td>
                                  </tr>
                                <tr>
    <td>
                                       <form>
                                                <input value="3" size="3" name="num" disabled />
      </form> 
   </td>
</tr>                                
                                  <tr>
                                      <td>
                                          <input type="submit" value="Crea" class="button" />
                                      </td>
                                  </tr>
                              </table>
                               <input type="hidden" name="selezione" value="<s:property value="selezione" />"/> 
                               <input type="hidden" name="ricerca" value="<s:property value="ricerca" />"/> 
                               <input type="hidden" name="sottoparola" value="<s:property value="sottoparola" />"/>
                          </form>

Nel modello di pagina inserisco lo script:

     <wp:outputHeadInfo type="JS"> 
              <link type="text/javascript"   href="<wp:resourceURL/>/js/contatorecaratteri.js"/> 
    </wp:outputHeadInfo>
        
    <script type="text/javascript" runat="server" src="<wp:resourceURL/>/js/contatorecaratteri.js"></script>  

Cosa sbaglio?
errore.png

William Ghelfi

unread,
Jan 11, 2013, 10:43:25 AM1/11/13
to ent...@googlegroups.com
Hi Salvatore,

the screenshot shows an XML error typical of Firefox.
To better clarify: that error message is by Firefox, not Entando.

Your HTML code doesn't seem to be valid.

Hope this helps you to proceed further in your debugging.

Reply all
Reply to author
Forward
0 new messages