Re: console.putmsg alternative that returns a string
By: Nightfox to Psi-Jack on Sun Oct 05 2014 09:51 am
Ni> Re: console.putmsg alternative that returns a string
Ni> By: Psi-Jack to Nightfox on Wed Oct 01 2014 09:32:55
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 use
Ni> an anonymous function for the replacement value in the JavaScript string
Ni> replace() method? I've often referred to the w3schools.com JavaScript
Ni> documentation, and their documentation for the string replace() method
Ni> seems to imply that it expects a string for the replacement value:
Ni> 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. ;)
---
>>>[Psi-Jack -//- Decker]
■ Synchronet ■ Decker's Heaven -//- bbs.deckersheaven.com
|