本文介绍了从javascript解析Fusion Chart特殊字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

专家,
我是Uday Satardekar,
我在项目中使用融合图进行图形表示.

我正在显示图形反对类别.
并且我的类别包含一些特殊字符,例如& ;,''等.
因此,它无法生成正确的xml.

对于特殊字符,我使用了SecurityElement.Escape.

例如

Hi Expert,
I am Uday Satardekar,
I am using fusion chart for graph representation in my project.

And i am showing graph agaist category.
and my category contains some special characters like &,'' etc.
Because of this it not generating proper xml.

For special characters i have use SecurityElement.Escape.

eg

for (int i = 0; i < dtReport.Rows.Count; i++)

            {

                strXML += "<set name='" + SecurityElement.Escape(dtReport.Rows[i]["fieldName"].ToString()) + "' value='" +SecurityElement.Escape(dtReport.Rows[i]["Totalcount"].ToString()) + "' />";

            }




现在strXML会生成包含特殊字符的正确xml.我使用断点进行检查.

但仍然无法生成图形.
我还必须替换javascript(FusionChart.js)中的特殊字符.


请帮助我修改此javascipt.

预先感谢.




now strXML generate proper xml including special characters.I check this using breakpoints.

But still its not generating graph.
I thing i have to replace special characters from javascript(FusionChart.js) also.


Please help me to modify this javascipt.

Thanks in advance.

推荐答案

swfNode += ' id="'+ escape( this.getAttribute('id')) +'" name="'+ escape( this.getAttribute('id')) +'" ';




上面的代码对我有用.




Above code working for me.


这篇关于从javascript解析Fusion Chart特殊字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 14:38