Shoutbox

Replace Text - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Replace Text (/showthread.php?tid=72911)

Replace Text by ArkaneArkade on 03-23-2007 at 02:47 AM

Hey guys,

I'm very, very new to scripting and I'm looking for a little help.  I've tried searching the forums but havent found anything I understand.

Basically I need to open a HTTP link.  I;ve done some previous scripting in mIRC but obviously plus is quite different.

All I need is to send a line to be processed into HTML.  The only thing I need for this function really, is to replace all spaces with %20 so that the HTTP will be transmitted right.

I couldn't find the replace in any form I understood - would anyone maybe be able to explain it to me?

Cheers


RE: Replace Text by matty on 03-23-2007 at 03:24 AM

code:
function _replace(_stext){
    _stext.replace(/ /g, '%20');
}

RE: Replace Text by phalanxii on 03-23-2007 at 07:02 AM

You can also use this (click here):

code:
encodeURI(URIString)

RE: Replace Text by ArkaneArkade on 03-23-2007 at 01:30 PM

ok, cheers guys.  thats perfect.
Thanks for putting the replace in that way, I think I'll be able to use it ok now.
And cheers for the encodeURI suggestion - I think that will actually solve my problem perfectly.
thanks all