Subj : console.putmsg alternative that returns a string
To : Psi-Jack
From : Nightfox
Date : Mon Oct 06 2014 12:47 pm
> Ps>> text = text.replace(/@([^@]+)@/g, function(m, code) {
> Ps>> return bbs.atcode(code);
> Ps>> });
>
> Ni> That seems to work well. I'm curious, how did you find that you
could
> Ni> use an anonymous function for the replacement value in the
JavaScript
> Ni> string replace() method? I've often referred to the w3schools.com
> Ni> JavaScript documentation, and their documentation for the string
> Ni> replace() method seems to imply that it expects a string for the
> Ni> replacement value: www.w3schools.com/jsref/jsref_replace.asp
>
> Well, I didn't.. This is just stuff Deuce came up with for the
> newuser_signup.js I've been testing. ;)
Ah, I see.
I tried the code that you shared, and I think it might need some more
tweaking, as it seems it will replace text around a @ even if it's not a valid
Synchronet @-code..
Nightfox
---
� Synchronet � Vertrauen � Home of Synchronet � telnet://vert.synchro.net