๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.javascript
Article #39726

Re: zamiana + na %2B przy uzyciu RegExp???

#39726
From: niedziedz
Date: Sat, 29 Apr 2006 12:19
19 lines
1393 bytes
> Chce zamienic w stringu kazde wystapienie ย + na %2B
> Wymyslilem cos takiego ale skrypt nie chce mi sie wykonywac. Wystarczy ze
> zmienie + na cos innego, np jakas literke to jest ok.
> 
> regEx = new RegExp("+","g");
> var aa2 = form.tytul.value.replace(regEx, "%2B");
> 
> Prosze o pomoc bo nie znam sie zbytnio na js ale musialem z niego
> skorzystac.

regEx = new RegExp("[\+]","g");
var aa2 = form.tytul.value.replace(regEx, "%2B");

a teraz ? :>

Pozdrawiam

-- 
Wysล‚ano z serwisu OnetNiusy: http://niusy.onet.pl
Technical Details
Message-ID: <73ea.0000006f.445359e6@newsgate.onet.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.onet.pl!newsgate.onet.pl!niusy.onet.pl
References: <e2v9tm$8m7$1@inews.gazeta.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.onet.pl!newsgate.onet.pl!niusy.onet.pl
From: niedziedz@vp.pl
Newsgroups: pl.comp.lang.javascript
Subject: Re: zamiana + na %2B przy uzyciu RegExp???
Date: 29 Apr 2006 14:19:51 +0200
Organization: Onet.pl SA
Lines: 19
Message-ID: <73ea.0000006f.445359e6@newsgate.onet.pl>
References: <e2v9tm$8m7$1@inews.gazeta.pl>
NNTP-Posting-Host: newsgate.onet.pl
Mime-Version: 1.0
X-Trace: newsgate.test.onet.pl 1146313191 17797 213.180.130.18 (29 Apr 2006 12:19:51 GMT)
X-Complaints-To: abuse@onet.pl
NNTP-Posting-Date: 29 Apr 2006 12:19:51 GMT
X-Mailer: http://niusy.onet.pl
X-Forwarded-For: 83.11.11.8, 192.168.243.35
X-User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;    Maxthon; .NET CLR 1.1.4322)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit