Problem with HTML characters in CUSTOM JS

I have made a function that replaces the character " " by "" (not space).

One of the lines of the function is:


...

$(this).html($(this).html().replace(/ /g, ''));

...



The function works perfectly when save, but when I return to the editor BeTHeme has changed my typed function: it has replaced " " by a " " (space).

...

$(this).html($(this).html().replace(/ /g, ''));

...


The function, without saves, continues to work correctly but the problem is that if I save the function with this changed line it stops working, and I need to replace " " not a " ".

I would appreciate it if the CUSTOM JS could keep the function as it is written (as if it were plain text, not HTML).


Thanks.

Comments

Sign In or Register to comment.