string.replace() not replacing ALL
This question already has an answer here:
Use:
value.replace(/+/g, ' ')
g
is a global match flag and will cause your replace to match all instances of +
.
Try ...
$("#edit_order #"+key).val(value.replace(/+/g,' '));
To replace all, your value "to replace" must be defined as a regular expression.
Here's a jsFiddle
链接地址: http://www.djcxy.com/p/16852.html上一篇: 从另一个表中更新行