Javascript code issue

29 views
Skip to first unread message

whatever

unread,
Mar 7, 2012, 10:44:01 AM3/7/12
to TiddlyWiki
Hi!

I'm working on a generic infobox plugin, but I'm still having a couple
of bugs to work out. One of them I've narrowed down to the following
piece of code (beware googlewrap):

<script>
var list = store.getTaggedTiddlers("systemConfig");
var validTypes;
var i;
for (i = 0; i < list.length; i++) {
validTypes += list[i].title + ", ";
}
wikify("No. of tiddlers: " + list.length + "<br/>List of tiddlers: " +
validTypes, place);
</script>

The problem is, that at the beginning of the list, it (validTypes)
puts "undefined". What am I missing?

w

Jeremy Ruston

unread,
Mar 7, 2012, 10:56:28 AM3/7/12
to tiddl...@googlegroups.com
You need to initialise validTypes like this:

var validTypes = "";

Cheers

Jeremy

> --
> You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
> To post to this group, send email to tiddl...@googlegroups.com.
> To unsubscribe from this group, send email to tiddlywiki+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/tiddlywiki?hl=en.
>

--
Jeremy Ruston
mailto:jeremy...@gmail.com
http://www.tiddlywiki.com

whatever

unread,
Mar 7, 2012, 1:50:34 PM3/7/12
to TiddlyWiki
Yes, that was it! Thanks!
w
> > For more options, visit this group athttp://groups.google.com/group/tiddlywiki?hl=en.
>
> --
> Jeremy Ruston
> mailto:jeremy.rus...@gmail.comhttp://www.tiddlywiki.com

Craig in Calgary

unread,
Apr 4, 2012, 12:04:44 PM4/4/12
to tiddl...@googlegroups.com
I would be interested in your final generic InfoBox results. I've done some similar tweaking but my results are to specific to the TW I worked in. Thanks in advance. Craig
Reply all
Reply to author
Forward
0 new messages