incubator-jspwiki-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bob Paige" <bobpa...@gmail.com>
Subject creating new pages through javascript
Date Mon, 07 Jul 2008 15:29:26 GMT
I am trying to create new pages through javascript and assign some default
content. If there is a better way to do this, I'm all ears.

What I am trying (and failing) is this:
[new
page|javascript:location.href="http:Edit.jsp?page="+escape(prompt('New%20page%20name...'))+"&_editedtext=[{TableOfContents}]"]

This will prompt the user for a name, then redirect to the edit.jsp for that
page. I have found that including the "&_editedtext=someting" on the URL
will populate the text area. But in this case (because I am trying to
include a call to a plugin) the ']' on the plugin is being interpreted as
the closeing ']' on the link. Is there some way to encode or otherwise
escape the ']' in this case?

Disclaimer:
I know I am opening myself up by allowing the javascript: interwiki link,
but this is an internal wiki so it should be ok.

Thanks.

-- 
Bobman

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message