`
easonfans
  • 浏览: 251812 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

js innerHTML 操作struts标签

阅读更多

翻译的文章在这:http://www.coderanch.com/t/54364/Struts/INNERHTML

那个解答原文是:

When you create HTML dynamically with INNERHTML, you must use regular HTML tags, not Struts tags. So, rather than create an <html:text> tag, you must create an <input type="text"> tag.

Struts tags can only be evaluated on the server and then rendered into regular HTML before being sent to the browser. Since JavaScript executes on the browser, you must deal exclusively with regular HTML, and not with tags that are interpreted on the server.

 

大意就是:

Struts 的标签只能被服务器解释,而js只能操作html的标签!

 

所以你使用innerHTML +=struts标签可不对,我也试过,真的不行

另外看到其他中文的文章,如:

http://www.iteye.com/topic/132037

中zarger也提到了这个问题!

我不知道这样还有没有别的解释,如果大家谁有好的解释,及时告诉我好么!!!

谢谢大家,一起进步吧。 

哦,还有别的方法:http://blog.csdn.net/grubbyfan/archive/2009/01/09/3743344.aspx不过我没试过。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics