|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
Javascript to replace plus sign I have some text and using java script i need to replace the plus sign, so the question is Javascript to replace plus sign or any single character from a long text like for example : Code: firsttext+secondtext&thirdtext?fourthtext=firstvalue&firsttext+secondtext&thirdtext?fourthtext=secondvalue |
#2
| |||
| |||
Re: Javascript to replace plus sign You will have to write a java script code for each character, example : Code: replace("+", "text"). replace("?", "text"). replace("&", "text"). replace("=", "text"). |
#3
| |||
| |||
Re: Javascript to replace plus sign Thanks for replying that quick, really appreciate your help, but i already this method, doesn't help. This only replaces the first occurrence of the sign with the text but the later one remains as it is. Any other method? Please help! ![]() |
#4
| |||
| |||
Re: Javascript to replace plus sign Well did you try this method : Code: replace(/+/g, "text") replace(/?/g, "text") replace(/&/g, "text") replace(/=/g, "text") ![]() |
![]() |
|
Tags: javascript, plus sign, replace character |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Javascript to replace content of div | Kalyug | Software Development | 7 | 20-05-2010 10:10 AM |
JavaScript - location.replace | Cordaro | Software Development | 6 | 13-05-2010 11:55 PM |
javascript replace function not working | Cornnelius | Software Development | 5 | 13-05-2010 12:12 AM |
Javascript to replace all double quotes | Amy Adams | Software Development | 5 | 12-05-2010 10:15 AM |
How to replace HTML code using javascript | visioneye | Software Development | 6 | 11-05-2010 11:38 PM |