I want to pass a para开发者_StackOverflowms string include style Tag like example:
a:"<font color=blue>testing!@#$%^&*()_+{}|:"<>?-=[]\;',./"
i am using decodeURI to pass the string.but still got error in extjs.
I has been checked,is a symbol % cause this error come out.
How to solve it??
Not sure that I understand your question completely, but you should probably start by escaping your string to prevent the second "
from terminating your string.
// Original:
a:"<font color=blue>testing!@#$%^&*()_+{}|:"<>?-=[]\;',./"
You can tell by the syntax highlighting that the original string is terminated premature.
// Escaped:
a:"<font color=blue>testing!@#$%^&*()_+{}|:\"<>?-=[]\\;',./"
By using the escape character \
you can tell JS to interpret the second "
as part of the string, and not a string terminator. You should also escape the \
character near the end of your string to prevent JS thinking you are using it to escape the ;
character.
1)Ext.getCmp('txt').setValue(Ext.util.Format.htmlDecode(getSel.data.Message));
use Ext.util.Format.htmlDecode
2nd part is params: { msg: (Ext.getCmp('txt').getValue())
no need to encode
3)
Page Language="C#" AutoEventWireup="true" CodeBehind="Msg.aspx.cs" Inherits="Msg" ValidateRequest="false" %>
open Msg.aspx add in ValidateRequest="false"
精彩评论