Visualizzazione dei risultati da 1 a 9 su 9
  1. #1
    Utente di HTML.it
    Registrato dal
    Feb 2005
    Messaggi
    116

    inserire uno script in una table

    Ciao... per esigenze di layout/formattazione dovrei inserire lo script qui sotto in una tabella (formata da 3 righe e con la riga di mezzo suddivisa in tre colonne)...

    codice:
    <%
    		// VERIFICO CHE SIA STATO INSERITO UN VALORE NELLA QUERYSTRING
    		if  (isNaN(idImg)) Response.Write("Nessuna immagine richiesta");
    		else
    		{
    			// VERIFICO CHE L'IMMAGINE RICHIESTA ESISTA
    			var fso = new ActiveXObject("Scripting.FileSystemObject");
    			if (!fso.FileExists(Server.MapPath(percorso + "/" + idImg + ".jpg")))
    			{
    				Response.Write("Impossibile trovare l'immagine # " + idImg);
    			}
    			// SE ESISTE, ALLORA LA STAMPO A VIDEO E...
    			else
    			{
    				Response.Write("<b class='Stile4'>Immagine # " + idImg + "[/b]
    
    [img]" + percorso + "/" + idImg + ".jpg[/img]
    
    ");
    				var dir = fso.GetFolder(Server.MapPath(percorso));
    				// ...E CREO UN MENU DU NAVIGAZIONE PER TUTTE LE IMMAGINI
    				for (var i=1; i<dir.Files.Count+1; i++)
    				{
    					Response.Write("<span class='Stile4'>[" + i + "]</span> ");
    				}
    				
    			}
    		}
    	%>
    e allora ho corretto in questo modo:

    codice:
    <table width="100%"  border="2" cellspacing="0" cellpadding="0">
              <tr>
                <td colspan="3"></td>
              </tr>
              <tr>
                <td></td>
                <th><%
    		// VERIFICO CHE SIA STATO INSERITO UN VALORE NELLA QUERYSTRING
    		if  (isNaN(idImg)) Response.Write("Nessuna immagine richiesta");
    		else
    		{
    			// VERIFICO CHE L'IMMAGINE RICHIESTA ESISTA
    			var fso = new ActiveXObject("Scripting.FileSystemObject");
    			if (!fso.FileExists(Server.MapPath(percorso + "/" + idImg + ".jpg")))
    			{
    				Response.Write("Impossibile trovare l'immagine # " + idImg);
    			}
    			// SE ESISTE, ALLORA LA STAMPO A VIDEO E...
    			else
    			{
    				Response.Write("<b class='Stile4'>Immagine # " + idImg + "[/b]
    
    [img]" + percorso + "/" + idImg + ".jpg[/img]
    
    ");
    				var dir = fso.GetFolder(Server.MapPath(percorso));
    				// ...E CREO UN MENU DU NAVIGAZIONE PER TUTTE LE IMMAGINI
    				for (var i=1; i<dir.Files.Count+1; i++)
    				
    				%></th>
                <td><%
    				{
    					Response.Write("<span class='Stile4'>[" + i + "]</span> ");
    				}
    				
    			}
    		}
    	%></td>
              </tr>
              <tr>
                <td colspan="3"></td>
              </tr>
            </table>
    ...ma qualcosa non fuziona e non riesco a capire cosa

  2. #2
    Utente di HTML.it L'avatar di fraude
    Registrato dal
    Feb 2004
    Messaggi
    2,870
    Ciao.

    Non capisco se non funziona la parte di codice asp o la formattazione html.

  3. #3
    Utente di HTML.it
    Registrato dal
    Feb 2005
    Messaggi
    116
    Praticamente.... a video dovrebbe crearmi nella cella destra della riga centrale l'elenco di tutti "numeri foto", ma non è così
    Mi stampa solamente un numero.

    Bhò!

  4. #4
    Utente di HTML.it L'avatar di fraude
    Registrato dal
    Feb 2004
    Messaggi
    2,870
    Hai previsto un ciclo per l'estrazione dei "numeri foto" ?

  5. #5
    Utente di HTML.it
    Registrato dal
    Feb 2005
    Messaggi
    116
    Lo script funziona perfettamente... purtroppo sbaglio a inserirlo nella tabella e quindi non funziona più.

  6. #6
    Originariamente inviato da UAZ
    Lo script funziona perfettamente... purtroppo sbaglio a inserirlo nella tabella e quindi non funziona più.
    hai controllato il codice html che stampa?

  7. #7
    Utente di HTML.it
    Registrato dal
    Feb 2005
    Messaggi
    116
    No, non avevo controllato... ecco cosa succede:

    codice:
    <table width="100%"  border="2" cellspacing="0" cellpadding="0">
              <tr>
                <td colspan="3"></td>
              </tr>
              <tr>
                <td></td>
                <th><b class='Stile4'>Immagine # 1[/b]
    
    [img]immagini/1.jpg[/img]
    
     </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  </th>  <td> <span class='Stile4'>[122]</span> </td>
              </tr>
              <tr>
                <td colspan="3"></td>
              </tr>
            </table>

  8. #8
    Utente di HTML.it
    Registrato dal
    Feb 2005
    Messaggi
    116
    Nessuno che può aiutarmi???

  9. #9
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Siamo un po' fuori tema.
    Costruisci per bene la tua tabella in HTML e poi un pezzetto alla volta rendi dinamica la parte che ti interessa.
    E' ovvio che se ripete trecento volte </th> vuol dire che l'hai messo nel posto sbagliato...

    Roby

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.