代替 '?'通过其ascii值 [英] replace '?' by its ascii value

查看:87
本文介绍了代替 '?'通过其ascii值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户提供时,表单中有一个文本框?进入该字段,则不允许我提交表单.因此,我正在尝试通过其ascii值转换该问号.我试图替换,所有其他字符都被其ascii值替换,但我无法替换?按其ascii值.

there is a textbox in a form , when user provides ? into that field , it doesn''t allow me to submit the form. So i am trying to convert that question mark by its ascii value. i tried to replace , all the other character were being replaced by its ascii value but i couldn''t able to replace ? by its ascii value.
so any help?

推荐答案

您不需要用ascii值替换.您可以只使用转义功能.

You do not need to replace with ascii values. You can just use the escape function.

var values = escape('?');



否则,值将等于%3F"



Aftewards, values will equal "%3F"


这篇关于代替 '?'通过其ascii值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆