By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,636 Members | 1,207 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,636 IT Pros & Developers. It's quick & easy.

Ajax page broken without reason

P: n/a
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&","&myye ar%>)"
<%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/prue...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?

Aug 29 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Seguros Catatumbo wrote:
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.

[...]
--
Rob
Aug 29 '06 #2

P: n/a
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)

Aug 29 '06 #3

P: n/a
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)

Aug 29 '06 #4

P: n/a
Seguros Catatumbo said the following on 8/29/2006 10:59 AM:
>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.
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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Aug 29 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.