צפיות
תשובות
עזרה…
לקחתי את הקוד של ניר שיש כאן באתר…
ושיפצתי קצת:
<body dir="rtl">
<script type="text/javascript">
if (document.getElementById){
document.write('<style type="text/css">n')
document.write('.submenu{display: none;}n')
document.write('</style>n')
}
function SwitchMenu(obj){
if(document.getElementById){
var el = document.getElementById(obj);
var ar = document.getElementById("masterdiv").getElementsByTagName("span");
if(el.style.display != "block"){
for (var i=0; i<ar.length; i++){
if (ar[i].className=="submenu")
ar[i].style.display = "none";
}
el.style.display = "block";
}else{
el.style.display = "none";
}
}
}
</script>
<%
SET Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.oleDb.4.0; data source=" & Server.MapPath("SalamiForum.mdb") & ";"
Set rs = Server.createObject("ADODb.Recordset")
SQL = "SELECT * FROM Messages ORDER BY Id"
rs.Open SQL, Conn, 2, 2
dim recArray
If Not rs.EOF Then
recArray = rs.getRows()
dim i
for i=0 to uBound(recArray,2)
if recArray(1,i)=0 then
%>
<table bgcolor="#ececec" width="830" border="1" bordercolor="#000000" cellspacing="0" valign="right"><tr><td>
<%
call showMessage(i)
%> </td></tr></table>
<br>
<%
end if
next
Else
Response.Write("אין הודעות")
End If
function showMessage(index)
dim subject
subject = recArray(2,index)
dim id
id = cint(recArray(0,index))
response.write "<div style='padding-right: 15px; text-align:right;'>"
response.write "<div id='masterdiv'>"
response.write "<div onclick='SwitchMenu('" & id & "')'>" & Subject & "</div>"
response.write "<span class='submenu' id='" & id & "'>"
response.write "" & ("Ami") & ""
for a=0 to uBound(recArray,2)
if recArray(1,a) = recArray(0,index) Then
%></span><%
call showMessage(a)
end if
next
end function
%></div>
בקיצור אז אני מנסה לשים משתנים …
אז ה: " & rs("ami") & " זה המשתנה וזה לא עובד…
שמעתי שאלברט הצליח לשים משתנים אז למישהו יש פיתרון?
6 תשובות
הקפצה
תראה לנו קוד רלוונטי בלבד
ותסביר איפה בדיוק אתה מנסה להכניס משתנה.
זה פורום,
לא צ'אט, ולכן לא מקפיצים הודעה אחרי זמן כ"כ קצר.
הנה:
המשתנה:
<%=rs("Ami")%>
וזה עושה עושה שגיאה כאילו אין בו כלום
תנסה לשים גרש במקום גרשיים או אולי
בלי גרשיים בכלל
מה זה נותן?
יתן error כי הגרסים נותן ערך של שדה
טקסט בלי גרסים זה ערך מספר או משתנה