弹性+作为应用程序参数传递时,字符被空白替换
我将一个字符串参数作为 FlashVars 传递到 Flex 应用程序中,
该参数有时包含特殊字符,除了 + 符号之外,一切都显示良好,当它到达 Flex 时,它会被空白替换。
这是例如的场景。
我在 JS 中有一个局部变量,它获取一些值,对于这个示例,它可以如下所示
<script language="JavaScript" type="text/javascript">
var testVar = "some_test_string_that_contains_+_character";
</script>
传递 "FlashVars","test="+testVar
然后到我的 Flex 对象 AC_FL_RunContent 我在 Flex 代码中 在我编写的应用程序的初始化中
var testValue:String = application.parameters["testVar"].toString();
Alert.show(testValue);
,现在显示效果很好,只是 + 字符被替换为空白。其他字符(如 /、@$-_)不会发生这种情况,但 + 字符会发生这种情况。
任何有关这方面的帮助将不胜感激。
I am passing a string param into flex application as FlashVars
The param sometime contains special characters, everything shows fine except + sign which gets replaced by blank when it reaches flex.
Here is the scenario for eg.
I have a local variable in JS that gets some values and for this example it can be taken as following
<script language="JavaScript" type="text/javascript">
var testVar = "some_test_string_that_contains_+_character";
</script>
Then to my Flex object AC_FL_RunContent I pass "FlashVars","test="+testVar
In the flex code on Init of application I have written
var testValue:String = application.parameters["testVar"].toString();
Alert.show(testValue);
Now this shows fine except the + character gets replaced by blank. It doesnt happens with other characters like /,@$-_ but the + character.
Any help regarding this will be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自 Adobe 文档:
进一步查看 matthew Horn 的评论之一,看起来您可以使用
%2B
来传递+
字符。From Adobe's docs:
Looking further down at one of the comments from matthew horn, it looks like you can use
%2B
to pass the+
character.