Home  >  Article  >  Backend Development  >  javascript - js upload problem

javascript - js upload problem

WBOY
WBOYOriginal
2016-10-17 09:30:121041browse

javascript - js upload problem

These small blocks are generated through the add button below. If it is a form, it is fine. Now I am in trouble.
The upload button is a plug-in written in js and must be rendered before it can be used. If it is appended using append, the button cannot be used. Yes, is there any way to solve it?

Reply content:

javascript - js upload problem

These small blocks are generated through the add button below. If it is a form, it is fine. Now I am in trouble.
The upload button is a plug-in written in js and must be rendered before it can be used. If it is appended using append, the button cannot be used. Yes, is there any way to solve it?

jquery on method:

<code>$("body").on("click", '上传按钮的id或类名', function(){
    // 触发上传事件
});</code>

Using js to implement, the principle is to monitor the click event of the body, and trigger the event when event.traget is the target.


I actually don’t quite understand what you mean when you say that the upload button is a plug-in written in js. I temporarily think that clicking the button will call this plug-in. If not, please describe it in more detail.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn