开发者

What kind of escaping for java applet parameters?

suppose I want to embed arbitrary characters in an applet parameter tag. It might be chinese. It might just be a string with embedder single or double quotes

I've found no statement how this should be done.

<param name='foo' value='this is \开发者_高级运维"a string with quotes\"'>

would be my first guess, but it seems not to be good enough.


The strings defined in the param tag are interpreted by your browser and passed on to the Java runtime. Java itself does not modify them in any way.

So the param tag obeys the standard rules for HTML: In its attributes, you can use any character that is valid in HTML attributes; for escaping them, you can use standard HTML entities:

<param name="foo" value='this is "a string with quotes"'>
<param name="bar" value="this is &quot;another string with quotes&quot;">
<param name="baz" value="using both double quotes: &quot &amp; single quotes &#39;, with some literal 文字 characters">
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜