toggle: Fix incompatability between javascript and webkit.
[ikiwiki] / doc / bugs / toggle_fails_on_Safari.mdwn
1 The [[plugins/toggle]] plugin has no effect when viewed on the Safari web browser.
2
3 All toggles appear open all the time.
4
5 I don't know if this is true for other webkit browsers (the new Konqueror, the iPhone, etc).
6 I'm currently testing in the Safari nightly builds, but I've seen the bug in the current release
7 of Safari too.
8
9 Looking at the Safari Web Inspector, it believes there is a parse error on line 47 of the
10 [[news]] page.  This is the definition of the getElementsByClass(class) function.
11
12     45 }
13     46
14     47 function getElementsByClass(class) {
15        SyntaxError: Parse error
16     48  var ret = new Array();
17
18 > Reproduced in epiphany-webkit on debian.
19
20 > Also noticed something interesting when I opened the page in vim. It
21 > highlighted the "class" like a type definition, not a variable. Sure
22 > enough, replacing with "c" fixed it.
23
24 > I wonder if webkit is actually in the right here, and using a reseved
25 > word like, presumably, "class" as a variable name is not legal. As I try
26 > to ignore javascript as much as possible, I can't say. [[done]] --[[Joey]]