简体   繁体   English

如何使用jQuery创建流畅的html元素

[英]How to create fluid html elements with jQuery

How can I create with jQuery a Fluid element, like: 如何使用jQuery创建Fluid元素,例如:

<f:form.upload property="{something}" additionalAttributes="{form:someProperty(element: element, property: 'myProperty'}"></f:form.upload>

I tried to write something like: 我试图写类似:

var input = <f:form.upload property="{something}" additionalAttributes="{form:someProperty(element: element, property: 'myProperty'}"></f:form.upload>;
$(div).append(input);

But it will render litteraly the content of var input . 但它会呈现litteraly VAR的内容input


In other words. 换一种说法。

What I get now wit my jQuery: 我现在用我的jQuery得到了什么:

<input type="file" name="tx_form_formframework[application][fileupload]">

What I want: 我想要的是:

 <input type="file" name="tx_form_formframework[application][fileupload]"> 

in short: you can't. 简而言之:你不能。 This is because the <f:*> tags and {variables} are being processed on the server, not on the client. 这是因为<f:*>标记和{variables}在服务器而不是客户端上进行处理。

Jquery could try to grab the processed HTML bits from the server via an HTTP request, but that's pretty much it :) jQuery可以尝试通过HTTP请求从服务器获取经过处理的HTML位,但是就这样:)

在某些情况下,可以预先通过Fluid创建表单字段,但是可以将其隐藏,直到用户执行定义的操作为止。

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

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