javascript - Howo to check entry.value and change if it contains junk characters? -
javascript - Howo to check entry.value and change if it contains junk characters? -
how can phone call function check value of {$entry.value} , if contains "¿" remove "¿" , send rest of text back.
<option value="">select</option> <c:foreach var="entry" items="${valueslist}"> <option value="${entry.key}" id=> ${entry.value} </option> </c:foreach> function updatevalue(selectobj) { xxxx }
my real problem when ajax call, junk characters "Â" added "data"
jquery.post("${issuersurl}", { action : actionselected, ajax: 'true',"nocache": nocache, "hugxxxxxxxxxxxxxx5430":tokenvalue }, function(data) { query("select#programs").html(data).removeattr('disabled').removeclass('loading'); } );
i tried find solution nil worked. thought can check entry.value , alter if has "Â"
if trying remove special characters:
jquery.post("${issuersurl}", { action : actionselected, ajax: 'true',"nocache": nocache, "hugxxxxxxxxxxxxxx5430":tokenvalue }, function(data) { var data_new = data.replace(/[^a-z0-9\s]/gi, '').replace(/[_\s]/g, ''); query("select#programs").html(data_new).removeattr('disabled').removeclass('loading'); } );
if not, modify [^a-z0-9\s] fit needs of characters. let's want allow "?" character, add together so: [^a-z0-9?\s]
javascript jquery jsp
Comments
Post a Comment