PDA

View Full Version : Asp supporta Javascript al 100%? Posso eseguire questo codice?


gik25
26-03-2004, 14:57
function TransformaPagina(pagina, numerofilmperpagina)
{
id_database1.recordset.moveFirst();

var estrai = "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" height=\"611\">";

var i = 0;
var start_item = (pagina-1)*numerofilmperpagina

while (i<pagina*numerofilmperpagina && !id_database1.recordset.EOF)
{
if(i>=start_item)
{
titolo = id_database1.recordset("titolo");
nomefile = id_database1.recordset("link");
voto = id_database1.recordset("voto");
autore = id_database1.recordset("autore");
descrizione = id_database1.recordset("descrizione");
tipo = id_database1.recordset("tipo");
percorsoimmagine = id_database1.recordset("nomeimmagine");

temp = "<tr><td height=\"19\" style=\"border-style: ridge; border-width: 3\" colspan=\"3\"><a class=\"titolo\" href=\"nomefile\"><font class=\"m1\">*tipo*</font> <font class=\"m2\">*titolo*</font></a><font class=\"m2\"><br><font class=\"m3\">*descrizione*<br><font class=\"m4\">di *autore*</font><p><font class=\"m5\"><b>Voto: *voto*</b></font></p></font></font><p>&nbsp;</p></td><td height=\"19\" style=\"border-style: ridge; border-width: 3\" colspan=\"2\"><img border=\"0\" src=\"*percorsoimmagine*\" width=\"109\" height=\"170\"></td></tr>"
temp = temp.replace("*titolo*",titolo);
temp = temp.replace("*nomefile*",nomefile);
temp = temp.replace("*voto*",voto);
temp = temp.replace("*autore*",autore);
temp = temp.replace("*descrizione*",descrizione);
temp = temp.replace("*tipo*",tipo);
temp = temp.replace("*percorsoimmagine*",percorsoimmagine);
temp = temp.replace("''","´'");

estrai += temp;
}

i++;
id_database1.recordset.moveNext();
}

hrefcode = "TransformaPagina(*pagina*,*numerofilmperpagina*)"
hrefcode = hrefcode.replace("*pagina*",pagina+1);
hrefcode = hrefcode.replace("*numerofilmperpagina*",numerofilmperpagina);
code = "<tr><td align='center'><br><img border=\"0\" id=\"img32\" onclick=\"*pagina*\" src=\"Pulsanti/button15.gif\" height=\"26\" width=\"144\" alt=\"Recensioni Precedenti\" onmouseover=\"FP_swapImg(1,0,/*id*/'img32','Pulsanti/button16.gif')\" onmouseout=\"FP_swapImg(0,0,/*id*/'img32','Pulsanti/button15.gif')\" onmousedown=\"FP_swapImg(1,0,/*id*/'img32','Pulsanti/button14.gif')\" onmouseup=\"FP_swapImg(0,0,/*id*/'img32','Pulsanti/button16.gif')\" fp-style=\"fp-btn: Metal Capsule 1; fp-transparent: 1; fp-proportional: 0\" fp-title=\"Recensioni Precedenti\"><br>&nbsp;</td></tr>"
estrai = estrai + code.replace("*pagina*",hrefcode);
lista.innerHTML = estrai;
}

gik25
26-03-2004, 14:58
id_database è collegato a un database xml...
Per farlo in html basta una riga e in asp?