From: coby ingram <coby@pe...> - 2011-03-18 20:04:25
I'm trying to find a better way to generate unique ID's for the
folding plugin than random_string(5). What I'd like to do is take the
current page name and append an integer that just gets iterated if it
already exists. That method comes recommended by the inventor of JSON
so I think "It's so crazy... It just might work!"
Well, how do you access that page name in a script? It isn't "title"
or "current" or even "woas.set_as_current.current". Those either give
me "undefined" or an empty string. And trying to access it through
the dynamic page content, like appending
"+woas.getHTMLdiv(d$('woas_title'))" to the text string, just makes
you see ONLY the folding text. Weird.
Sorry, this is probably completely obvious, but give me a break. It's
also completely undocumented.
>How do you access the page name in a script?
Alas, there is no reliable way to get the page name.
There is a P.body, but not a P.name. But it can be added as a plug in... although it should be in the core.
you can email me at niltoncastillo@... if you want that code, its only a few lines, but its on my laptop.