Javascript 我可以用jQuery将apex元素附加到html中吗?
在visualforce页面中,如果我有一个完全用jQuery动态创建的DOM,我可以动态附加以下代码吗Javascript 我可以用jQuery将apex元素附加到html中吗?,javascript,jquery,html,apex,Javascript,Jquery,Html,Apex,在visualforce页面中,如果我有一个完全用jQuery动态创建的DOM,我可以动态附加以下代码吗 <div id="file"> <apex:inputFile value="{!attachment.body}" filename="{!attachment.name}" id="file" title="Upload Attachment" styleclass="fileType"/> </di
<div id="file">
<apex:inputFile value="{!attachment.body}" filename="{!attachment.name}" id="file" title="Upload Attachment" styleclass="fileType"/>
</div><br />
我可以用jQuery将apex元素附加到html中吗?您可以使用.append()
:
$(“#file”).append(“我很确定这种方法不起作用。可能使用常规html元素,但不使用apex元素。抱歉,我这样做了,它不起作用。我真的希望这样做,但没有乐趣。
$('#file').append('<apex:inputFile value="{!attachment.body}" filename="{!attachment.name}" id="file" title="Upload Attachment" styleclass="fileType"/>');