Home jquery Text Replacement JQuery

Text Replacement JQuery

Author

Date

Category

Hello.

How can I replace a space on a plus? Is Str_replace in jQuery?

var blabla = 'bla bla';

in

var blabla = 'bla + blale';

I do it, then insert in the browser line

history.pushstate (null, null, 'http: //' + window.location.host + '/' + blabla);

But it turns out in the browser string instead of spaces% 20.

Thank you.


Answer 1, Authority 100%

So you can

var blabla = 'bla bla';
  BLABLA.REPLACE ("", "+");
//  or
  BLABLA.REPLACE ("/ S", "+"); // so more correctly, but will replace only one space on the character + so if in a row in each other there is more than 1 space, then you need to replace otherwise

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions