innerHTML + XHTML = bug
Posted 17 October 2006 - 01:43 PM
I know there are createElement and appendChild methods. But I need to be able to write within the elements my script creates as well. Is there a way to do something like a document.write within my body element? Is write available for an element retrieved with a getElementByID?
Posted 17 October 2006 - 04:27 PM
EDIT: I have a copy of my XHTML at http://www.nightslyr.../calendar2.html
The CSS (which isn't working at this point because of my error) is at http://www.nightslyr...ar/calendar.css
Posted 17 October 2006 - 10:59 PM
What do you mean by "source code"? Where isn't it appearing?
What I mean is this:
I have a very simple XHTML page that literally only consists of an empty body element (well, there's the normal XHTML Strict head element goodies...).
My script outputs the calendar, which are nested tables, as the innerHTML of the body element.
When I try to view the XHTML source code from the browser, all it shows is my empty body element without any of the innerHTML stuff my script created within it.
Is this normal? I thought that whatever was placed in innerHTML would be visible in the XHTML source if I looked at the source after the page was rendered.
Posted 18 October 2006 - 12:07 AM
Posted 18 October 2006 - 12:14 AM
Well, that stinks. Looks like I'll have to code the tables directly into my markup.
Posted 18 October 2006 - 12:18 AM
Posted 18 October 2006 - 02:52 AM
Because I've been relying on an external script to print everything (tables and the data inside) using innerHTML, they're not 'seeing' my external CSS file. I figure that I can code the nested tables (one for the overall structure (3 months across by 4 months high), one for each calendar month) directly into the markup in order to ensure the CSS formatting works as a yearly calendar's overall structure will always remain the same (12 months to a year, at most 5 weeks/rows, depending on how late a month starts, a month). All that will change are the dates, which are derived by the script.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users