Ajax page broken without reason

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>&nbsp;</td>
<%elseif CurrentDay > LastDay(MyMonth, MyYear) then%>
<td>&nbsp;</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>&nbsp;</td>
<%elseif CurrentDay > LastDay(MyMonth, MyYear) then%>
<td>&nbsp;</td>

to:

If Row = 0 and Col < FirstDay then%>
<td class="myclass">&nbsp;</td>
<%elseif CurrentDay > LastDay(MyMonth, MyYear) then%>
<td class="myclass">&nbsp;</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?
 
R

RobG

Seguros said:
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:

Why are you asking about ASP here? This is a JavaScript news group.

[...]
 
S

Seguros Catatumbo

Similarly, if i want to add a simple class attribute to a table cell,
it stops working.

Ok, this was caused by a missing space in the css definition. But still
i cannot resolve the first one (taking the > out of the conditional
response.writes and just output just before the end tag)
 
S

Seguros Catatumbo

Why are you asking about ASP here? This is a JavaScript news group.

Because the problem itself isn't about ASP, but rather in how the data
gets received by ajax.

The ASP code is just responsible for returning the html (which is
valid)
 
R

Randy Webb

Seguros Catatumbo said the following on 8/29/2006 10:59 AM:
Because the problem itself isn't about ASP, but rather in how the data
gets received by ajax.

Then why post ASP code? It is irrelevant. What *is* relevant is the HTML
received by the browser - not what produced it.
The ASP code is just responsible for returning the html (which is
valid)

Nobody knows that but you because nobody has seen that HTML but you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,052
Latest member
KetoBeez

Latest Threads

Top