Hi!
I've been playing around with scripts for adding tags to tiddlers.
I've figured out how to do it using fET-generated lists of tiddlers,
however, I'm having trouble with passing values through transclusion.
I've come up with the following (beware googlewrap):
<<tiddler AddTagsScriptsTEST/testscript with:"tool,device">>
<part testscript hidden>
<script>
var strTagList = "$1";
var arrTags = strTagList.split(",");
var i;
for (i=0;i<arrTags.length;i++) {
document.write("<script label=\"Add "+arrTags[i]+"\" title=\"Add
"+arrTags[i]+"\">var here=story.findContainingTiddler(place); if
(here) tiddler=store.getTiddler(here.getAttribute(\"tiddler\"));
store.setTiddlerTag(tiddler.title,true,\""+arrTags[i]+"\"); </
script><br/>");
}
</script>
</part>
It should generate two links:
Add tool
Add device
On click, it would add the corresponding tag to the tiddler. Now, I
know that the script in the "document.write" line works, because I've
used it before, but I still get an error:
SyntaxError: unterminated string literal
");
}
</script>
I've tested it with JSLint (1), but it only reported:
Problem at line 5 character 1: document.write can be a form of eval.
I'm guessing the problem is in the first part, however, JavaScript is
not my strong suite, so if anyone has any suggestions, I'd be
grateful.
w
(1) http://www.jslint.com/
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/tiddlywiki?hl=en.