PDA

View Full Version : children has no properties


1212jtraceur
10-29-2006, 08:08 AM
I'm working on a JS/DOM based music player webpage. One of the major steps I have taken with this dynamically generating the HTML from the contents of the data array. This has caused a couple of problems...

The first, listed in the title occurs upon body.onload. body.onload calls initialize(), which then calls showInfo('dflt'), which calls setStyleOfChildren('infoContainer', 'display', 'none'). I think that tells me div#infoContainer has no children, which should be false because generatePlayerDivs(), generateImagesDiv(), generateInfoDivs(); are all called before showInfo('dflt').

Also, my images aren't being assigned their correct classes, and therefore, margins, through CSS. They are supposed to be in a table like layout with 20 px of space between them. I handle this by giving all images a 10px margin, then altering specific margin sizes based on 'class membership', which is assigned to images not completely surrounded by other images. getImageClass(x, y) works correctly, as far as I can tell, so this problem is in generateImagesDiv() (most likely the loop...).

Could you guys have a look at this and enlighten me? This is my first time coding DOM and I'm fairly new to JS.

Thanks,
1212jtraceur

1212jtraceur
10-29-2006, 03:11 PM
ok, I've solved the second problem. However, the first remains. Here is my new code, thanks.

1212jtraceur
10-30-2006, 03:55 AM
update: solved second problem a better way. Anyone out there have any idea why the first occurs?

code here (http://www.mydatabus.com/public/1212jtraceur/a/MusicPlayerEDIT.html).

1212jtraceur
11-02-2006, 12:09 AM
Partially fixed, see http://codingforums.com/showthread.php?p=501712.