Loren S Rose

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromLoren S Rose
ToMe
SubjectCollapsible List Generation script not working
Date1 December 2008 22:53
Collapsible List Generation JavaScript script

In use at [URL]

For an irc roleplaying game, I'd like basic classes to be at the top level
of the collapsible lists and have the upgraded classes within.  I will want
to display some additional data, but I want to start with the most simple
version and see if I can get that to work.

The problem is that the results of the script are not being displayed.  It
didn't look like I had to do anything with HTML since JavaScript both
creates it and displays it.

I would like help to get this working, or, failing that, a suggestion of a
script that might better serve my needs.

I ran the site on both Konquerer, Firefox, Seamonkey, and Opera, and
Galeon...seamonkey and galeon both being gecko based according to wikipedia
and am not getting any errors from any of them.  I am getting the same
results on all of them....nothing.  I checked the source code online and my
PHP include code seems to be working because the JavaScript code is showing
up.
FromMe
ToLoren S Rose
SubjectRe: Collapsible List Generation script not working
Date13 December 2008 19:17
Loren,

> The problem is that the results of the script are not being displayed.  

You have several mistakes in your code. Opera's error console very
nicely narrows them down (you should be able to see these if you look in
the error console).

1. The following lines are all invalid JavaScript syntax:

mylist.sub[0] = new sub.('Fighter',true);
...
mylist.sub[0].sub[2] = new sub('Samurai',);
...
mylist.sub[7] = new sub('Mage'),true);

Remove the extra "." from the first, the extra "," from the second, and
the extra ")" from the third.

2. The external classlist.js file contains HTML script tags, which
should not be there, followed by these syntactically invalid lines at
the start:
var classes=(27)
var sub = new Array(7) {
and this extra character at the end:
}

3. Twice you have used "myList" and the rest of the time you have used
"mylist". The language is case sensitive, and those two are not
equivalent. Choose one version of the name, and stick to it.

4. The external file seems to duplicate everything else on the main
page. As such, it is redundant. Delete it.

5. You have downloaded a copy of my script, but you have not told the
page to use it. You need to tell the page to use the collapsibleList.js
file in the same way as you have told it to use the classlist.js file.


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.