简体   繁体   English

aui:使用JavaScript编写标签

[英]aui: tag write using JavaScript

please how can I write aui:input HTML code via document.write() JavaScript function? 请问如何通过document.write()JavaScript函数编写aui:input HTML代码?

example: 例:

document.write('<aui:input name="' + name + '" label="' + name + '" type="text" />');

same problem with: 同样的问题:

document.write('<aui:input name="' + name + '" label="' + name + '" type="text"> </aui:input>');

I can only write standard tag. 我只能写标准标签。

Thank you :) . 谢谢 :) 。

edit (reaction on a Lucas NN's comment): 编辑(对卢卡斯·NN的评论有反应):

if I try to use aui:input instead of input it crashes with this error: 如果我尝试使用aui:input而不是input,则会因以下错误而崩溃:

00:47:21,317 ERROR [http-bio-8080-exec-65][MinifierUtil:111] 8: 23: unterminated string literal 00:47:21,318 ERROR [http-bio-8080-exec-65][MinifierUtil:111] 8: 23: syntax error 00:47:21,319 ERROR [http-bio-8080-exec-65][MinifierUtil:111] 85: 12: missing ; before statement 00:47:21,319 ERROR [http-bio-8080-exec-65][MinifierUtil:111] 89: 14: missing ; before statement 00:47:21,320 ERROR [http-bio-8080-exec-65][MinifierUtil:111] 100: 5: illegally formed XML syntax 00:47:21,320 ERROR [http-bio-8080-exec-65][MinifierUtil:111] 100: 5: syntax error 00:47:21,321 ERROR [http-bio-8080-exec-65][MinifierUtil:111] 120: 17: missing ; before statement 00:47:21,321 ERROR [http-bio-8080-exec-65][MinifierUtil:111] 134: 9: unterminated regular expression literal 00:47:21,322 ERROR [http-bio-8080-exec-65][MinifierUtil:111] 138: 7: unterminated regular expression literal 00:47:21,322 ERROR [http-bio-8080-exec-65][MinifierUtil:111] 141: 3: unterminated string literal 00:47:21,323 ERROR [http-bio-8080-exec-65][MinifierUtil:111] 1: 0: Compilation produced 10 syntax errors.

your second piece of code is ok just remove the aui: in your input tags. 您的第二段代码就可以了,只需在输入标签中删除aui:即可。 Same with your first piece. 与您的第一篇相同。 The reason we remove aui it is part of a different javascript library and it will not work with pure/no-library javascript. 我们删除aui的原因是它是另一个javascript库的一部分,因此无法用于纯/无库javascript。 Plus, if my source is correct, aui was replaced with the YUI Library. 另外,如果我的原始资料正确,则aui已替换为YUI库。

I would not know if you had another js library if you did not add the src. 如果您不添加src,我不知道您是否还有另一个js库。 What I mean is, aui is a different library, You need to have the script src defined. 我的意思是,aui是一个不同的库,您需要定义脚本src。

If you used the aui/YUI compiler, None of this will help 如果您使用了aui / YUI编译器,那么这些都无济于事

http://alloyui.com/tutorials/form-builder/ http://alloyui.com/tutorials/form-b​​uilder/
Also, Take a look at the form syntax with YUI/AUI it's a different approach, but it works. 另外,看看使用YUI / AUI的表单语法,这是一种不同的方法,但是可以使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM