如何通过ajax传递Superscript或特殊字符存储在xml中 [英] How to pass Superscript or special characters to store in xml through ajax

查看:65
本文介绍了如何通过ajax传递Superscript或特殊字符存储在xml中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我先解释一下情景。



我有2个列表框,列出一些单位和列表b,单位相同。对于前者列出我选择Kg并列出b我选择g。在发件人文本框中,我输入1,一旦键在收件人中,文本框1000就会显示。它是正确的。我用keyup事件做这个,即当键正在通过ajax将值传递给xml并且如果条件传递给c#,如果'From'单元和'To'单元匹配则计算。

例如如果列出一个im选择cm /s²并且当触发keyup事件时cm / s正确传递但是平方没有正确传递...所以当它传递给c#时,条件变为false并且它返回0到'To'文本框为0,即squuared或cubed作为未知符号传递。



请帮我解决如何通过ajax将平方传递给xml,如平方。



提前致谢



问候,

Naveen

I will explain scenario first.

I have 2 list boxes, list a with some units and list b with the same units. For ex. list a im selecting Kg and list b im selecting g. In 'From' textbox im entering 1 and as soon as the key is up in 'To' textbox 1000 will be displayed. it is working correct.Im doing this with keyup event i.e when the key is up im passing the values to xml through ajax and to c# if condition and if the 'From' unit and 'To' unit matches then it calculates.
For ex. if list a im selecting cm/s² and when keyup event is triggered the cm/s is passing correctly but the squared is not passing correctly...so that when it passes to c# the condition is becoming false and it is returning 0 to the 'To' textbox as 0 i.e the squuared or cubed is passin as a unknown symbol.

Please help me out how to pass the squared to xml through ajax as such as squared itself.

Thanks in advance

Regards,
Naveen

推荐答案

有没有特殊性格这样的东西。 HTML,JavaScript和.NET都支持Unicode。你无需做任何事情。使用HTML,您应该使用适当的Unicode charset 保存文件,该文件应为UTF-8。始终在HTTP-EQUIV中编写它是很重要的,即使UTF-8是您网站的默认设置(在本地保存您的页面的人不必知道它而不必修改文件):

There is no such thing as "special character". HTML, JavaScript and .NET all support Unicode. There is nothing you have to do about it. With HTML, you should save file using appropriate Unicode charset, which should be UTF-8. It is important to always write it in HTTP-EQUIV, even if UTF-8 is default for your site (people saving your pages locally don't have to know it and don't have to modify the file):
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />



要对HTML中的任意字符进行硬编码,您需要知道HTML 字符实体

http:// www.w3.org/TR/html4/sgml/entities.html [ ^ ]。



注意 &#...; (或&#0x ...; )语法允许您可以通过Unicode 代码点输入字符。



-SA


To hard-code any arbitrary character in HTML, you need to know HTML character entities:
http://www.w3.org/TR/html4/sgml/entities.html[^].

Note the "&#...;" (or "&#0x...;") syntax which allow you to enter a character by its Unicode code point.

—SA

这篇关于如何通过ajax传递Superscript或特殊字符存储在xml中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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