Salve,
avrei necessità di inserire una variabile, creata dal codice ASP, nel codice javascript. Ho provato a metterla così <%=strtesto%> ma non mi funziona.
Grazie a tutti
<%
Set objConn =Server.CreateObject("ADODB.Connection")
objConn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};" & "DBQ=" & Server.MapPath("/public/eventi.mdb")
objConn.Open
strSQL = "SELECT * FROM titolo ORDER BY data DESC,id"
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.ActiveConnection = objConn
objRS.Open strSQL, objConn
do while not objRS.EOF
strtesto =&objRS("testo")
objRS.MoveNext
loop
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
<html>
<head>
<script language="JavaScript" src="scroll.dflt.js"></script>
<script language="javascript" >
var LOOK = {
// scroller box size: [width, height]
'size': [350, 100]
},
BEHAVE = {
// autoscroll - true, on-demand - false
'auto': true,
// vertical - true, horizontal - false
'vertical': true,
// scrolling speed, pixels per 40 milliseconds;
// for auto mode use negative value to reverse scrolling direction
'speed': 5
}
</script>
<script language="javascript" >
// a data to build scroll window content
ITEMS = [
{
'file': '',
'content': '[b]strtesto
Guido',
'pause_b': 2,
'pause_a': 0
},
{
'file': '',
'content' : 'Item with some <font color="red">HTML</font>',
'pause_b': 2,
'pause_a': 0
},
{
'file': '',
// note: image path is relative to the ts_files directory
'content' : 'Item with image
[img]../../images/logo.gif[/img]',
'pause_b': 2,
'pause_a': 0
}
// add as many items here as you need.
// don't forget to separate them with commas, make sure there is no comma after the last item
]
</script>