[dokuwiki] Re: page id from javascript

Hello,

I suggest to add ID to the page body? Something like

diff -rN old-www/doku.php new-www/doku.php
78a80
>   echo (preg_replace('/(<body)([\s>])/i','\\1 
> id="ID:'.getID().'"\\2',ob_get_clean()));

Then scripts could retrieve this ID by querying document.body.id, and
there will be no additional vars in the window context.
Any required symbols are allowed for the ID attribute
http://www.w3.org/TR/html4/types.html#type-name and "ID should start
from [a-zA-Z]" requirement could be obeyed by using "ID:" prefix.


-- 
Best regards,
 Ilya                          mailto:ilya@xxxxxxxxxxx

-- 
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: