[dokuwiki] Re: using javascript in ext. link

Does anyone have any idea here?

Shai

On Mon, Apr 7, 2008 at 12:52 AM, Shai <shaibn@xxxxxxxxx> wrote:

> I could hide a few things I don't want to show though...
> I use this as a link in my Firefox as a bookmark and I just wanted to have
> it on my wiki too:
>
> javascript:(function(){function getSearchString () { s = null;
> if(document.selection && document.selection.createRange) { s =
> document.selection.createRange().text; } else if (document.getSelection) { s
> = document.getSelection(); } if (! (s && s.length)) { try { s =
> clipboardData.getData(%22Text%22); } catch (error) { } } if (! (s &&
> s.length)) { s = prompt('Enter name',''); } if (s.indexOf(%22mailto:%22)
> == 0) s = s.substring(7,s.length); i = s.indexOf(%22@xxxxxxxxxxxx%22); if
> (i > 0) s = s.substring(0,i); return s; } searchString = getSearchString();
> if (searchString != null) { if (searchString.length) { location = '
> http://localhost/pictures/' + searchString + '.jpeg'; } }  })();
>
> Shai
>
>
> On Mon, Apr 7, 2008 at 12:39 AM, Shai <shaibn@xxxxxxxxx> wrote:
>
> > Hi,
> >
> > I'm not really sure I want to paste the link I'm trying to put on my
> > private internal network wiki but security, it being a private wiki and all,
> > isn't a problem.
> > that said, when I use the javascript as a normal URL, it works, but when
> > embedded in [[javascript code here|link name]] it seems to want to use the
> > mailto and creates an email link (probably cause it sees a mailto somewhere
> > in the code.
> >
> > Shai
> >
> >
> > On Mon, Apr 7, 2008 at 12:16 AM, Christopher Smith <chris@xxxxxxxxxxxxx>
> > wrote:
> >
> > >
> > > On 6 Apr 2008, at 21:25, Shai wrote:
> > >
> > > > Hi,
> > > >
> > > > I know I can use the normal links syntax for links but when I tried
> > > > some javascript, it just didn't work.
> > > > Is there a way to do this?
> > > >
> > > > Shai
> > > >
> > >
> > > No, at least not if I understand you right.  Do you want to be able to
> > > include javascript as part of an external link in a wiki page?
> > >
> > > To allow javascript would be a security risk.  If its a private wiki
> > > or you are prepared to take the risk on your own wiki, you can enable HTML
> > > (refer htmlok config setting) and place the link as normal html between 
> > > html
> > > tags.
> > >
> > > If you are looking to open the link in a new window, check out target
> > > config setting.
> > >
> > > - Chris
> > > --
> > > DokuWiki mailing list - more info at
> > > http://wiki.splitbrain.org/wiki:mailinglist
> > >
> >
> >
>

Other related posts: