Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #7719

Re: Replace in String

From "Jukka K. Korpela" <jkorpela@cs.tut.fi>
Newsgroups comp.lang.javascript
Subject Re: Replace in String
Date 2011-10-27 14:46 +0300
Organization A noiseless patient Spider
Message-ID <j8bga1$ijj$1@dont-email.me> (permalink)
References <3856471.2893.1319713450524.JavaMail.geo-discussion-forums@yqnx19>

Show all headers | View raw


27.10.2011 14:04, "Shapper." wrote:

> I have the following:
>
>    var original = "<span>name at email dot com</span>"
>    var at = "at";
>    var dot = "dot";
>
>    email = original.text().replace(new RegExp(' ' + at + ' ', 'gi'), '@').replace(new RegExp(' ' + dot + ' ', 'gi'), '.');

If you look at the error console, you should see something like 
"original.text is not a function" there.

If you remove the part ".text()", the value of email becomes 
"name@email.com".

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/

Back to comp.lang.javascript | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Replace in String "Shapper." <mdmoura@gmail.com> - 2011-10-27 04:04 -0700
  Re: Replace in String "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2011-10-27 14:46 +0300

csiph-web