S
Seguros Catatumbo
Hi guys, i am having some weird issue with an ajax page.
I am designing a simple ajax calendar, because the one over yahoo is
about 200kb long, and mine is 9kb and really simple.
I am using classic asp for server side , and the routine that prints
the table rows corresponding the weeks of the calendar is like this:
For Row = 0 to 5%>
<tr>
<%For Col = 0 to 6
If Row = 0 and Col < FirstDay then%>
<td> </td>
<%elseif CurrentDay > LastDay(MyMonth, MyYear) then%>
<td> </td>
<%else%>
<td onclick="cargarfecha(<%=hoy+1&","&mymonth&","&myyear%>)"
<%if MyMonth = Month(Date) and CurrentDay = Day(Date) then
response.write " class='hoy' align='center'>"
else
response.write " >"
end if
hoy=CurrentDay
if hoy < 10 then
hoy = "0"&hoy
end if%>
<%=hoy%>
</td>
<%CurrentDay = CurrentDay + 1
End If
Next%>
</tr>
<%Next%>
Notice this part of the code:
<%if MyMonth = Month(Date) and CurrentDay = Day(Date) then
response.write " class='hoy' align='center'>"
else
response.write " >"
end if
and the closing td: </td>
If i erase the > chars in both response.writes earlier, and just put it
before the </td> (which would be the same code) then the calendar stops
working, without any errors in the firefox javascript console.
Similarly, if i want to add a simple class attribute to a table cell,
it stops working.
Change:
If Row = 0 and Col < FirstDay then%>
<td> </td>
<%elseif CurrentDay > LastDay(MyMonth, MyYear) then%>
<td> </td>
to:
If Row = 0 and Col < FirstDay then%>
<td class="myclass"> </td>
<%elseif CurrentDay > LastDay(MyMonth, MyYear) then%>
<td class="myclass"> </td>
Is there something i can do to fix this? I thought the ajax page was
getting confused since i am using responseText. I have tried to set the
result page's content type to help, but without luck.
Both firefox and IE are affected.
I have put a sample over this site:
http://www.seguroscatatumbo.com/prueba/calendario.asp
The page that is outputting the calendar to that page is:
http://www.seguroscatatumbo.com/prueba/leer_calendario.asp
That page just responds with a table, that i put inside a div on the
first page with innerHTML.
Can anyone help me?
I am designing a simple ajax calendar, because the one over yahoo is
about 200kb long, and mine is 9kb and really simple.
I am using classic asp for server side , and the routine that prints
the table rows corresponding the weeks of the calendar is like this:
For Row = 0 to 5%>
<tr>
<%For Col = 0 to 6
If Row = 0 and Col < FirstDay then%>
<td> </td>
<%elseif CurrentDay > LastDay(MyMonth, MyYear) then%>
<td> </td>
<%else%>
<td onclick="cargarfecha(<%=hoy+1&","&mymonth&","&myyear%>)"
<%if MyMonth = Month(Date) and CurrentDay = Day(Date) then
response.write " class='hoy' align='center'>"
else
response.write " >"
end if
hoy=CurrentDay
if hoy < 10 then
hoy = "0"&hoy
end if%>
<%=hoy%>
</td>
<%CurrentDay = CurrentDay + 1
End If
Next%>
</tr>
<%Next%>
Notice this part of the code:
<%if MyMonth = Month(Date) and CurrentDay = Day(Date) then
response.write " class='hoy' align='center'>"
else
response.write " >"
end if
and the closing td: </td>
If i erase the > chars in both response.writes earlier, and just put it
before the </td> (which would be the same code) then the calendar stops
working, without any errors in the firefox javascript console.
Similarly, if i want to add a simple class attribute to a table cell,
it stops working.
Change:
If Row = 0 and Col < FirstDay then%>
<td> </td>
<%elseif CurrentDay > LastDay(MyMonth, MyYear) then%>
<td> </td>
to:
If Row = 0 and Col < FirstDay then%>
<td class="myclass"> </td>
<%elseif CurrentDay > LastDay(MyMonth, MyYear) then%>
<td class="myclass"> </td>
Is there something i can do to fix this? I thought the ajax page was
getting confused since i am using responseText. I have tried to set the
result page's content type to help, but without luck.
Both firefox and IE are affected.
I have put a sample over this site:
http://www.seguroscatatumbo.com/prueba/calendario.asp
The page that is outputting the calendar to that page is:
http://www.seguroscatatumbo.com/prueba/leer_calendario.asp
That page just responds with a table, that i put inside a div on the
first page with innerHTML.
Can anyone help me?