无法让jquery文件上传器出现在页面上 [英] Can't get jquery file uploader to appear on page

查看:156
本文介绍了无法让jquery文件上传器出现在页面上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我正准备把头发拉出来。我一直在尝试两个不同的文件上传器库,Blueimp的jQuery文件上传器和Valums文件上传器。我无法使用任何一个上传按钮出现在我的页面上。我试图把它放在一个jQuery手风琴div内的一个窗体。我必须有一些问题,我的代码,以防止它出现在我的目标股利,但我什么都没有得到任何控制台的错误。只是没有出现。有任何想法吗?这里是我的代码的Blueimp版本:



HTML:

 < ; div id =photoclass =additionsDiv>< br /> 
网址:
< input type =textname =photourlsize =40>< / input>

< div id =photoUpload>
< noscript>
< input name =photoUploadtype =filesize =0/>< / input>
< / noscript>
< / div>
< / div>

Javascript:

  function addUploaders(){
$('#photoUpload')。fileupload();

};

链接的文件包括:

 < link type =text / csshref =libraries / blueimp / css / jquery.fileupload-ui.css rel =stylesheet/> 
< script type =text / javascriptsrc =libraries / blueimp / js / jquery.fileupload.js>< / script>
< script type =text / javascriptsrc =libraries / blueimp / js / jquery.fileupload-fp.js>< / script>
< script type =text / javascriptsrc =libraries / blueimp / js / jquery.fileupload-ui.js>< / script>
< script type =text / javascriptsrc =libraries / blueimp / js / main.js>< / script>


解决方案

如果您正在自定义界面,通过链接设置自定义上传进度条的简约界面。 。 。 。

该插件添加了自定义类的自定义跨度,以显示选定的文件,并准备上传。 。 。 。例如,

。 。检查blueimp demo的源代码

 <! - 列出可供上载/下载的文件 - > 
< table role =presentationclass =table table-striped>< tbody class =filesdata-toggle =modal-gallerydata-target =#modal-gallery> ;< / tbody的>< /表>

我建议您查看文档,这是非常详细的。 。 。


Okay, I am about to pull my hair out here. I've been trying two different file uploader libraries, Blueimp's jQuery file uploader and Valums file uploader. I can't get an upload button to appear on my page with either of them. I am trying to put it inside of a form within a jQuery accordion div. I must have some problem with my code that's preventing it from showing up in my target div, but I get nothing whatsoever as far as errors in the console. Just nothing shows up. Any ideas? Here's the Blueimp version of my code:

HTML:

<div id="photo" class="additionsDiv"><br />
                    URL: 
                        <input type="text" name="photourl" size="40"></input>
                        or 
                        <div id="photoUpload">
                            <noscript>
                            <input name="photoUpload" type="file" size="0" /></input>
                            </noscript>
                        </div>
                </div>

Javascript:

function addUploaders() {
$('#photoUpload').fileupload();

};

Linked files included:

<link type="text/css" href="libraries/blueimp/css/jquery.fileupload-ui.css" rel="stylesheet" />
    <script type="text/javascript" src="libraries/blueimp/js/jquery.fileupload.js"></script>
    <script type="text/javascript" src="libraries/blueimp/js/jquery.fileupload-fp.js"></script>
    <script type="text/javascript" src="libraries/blueimp/js/jquery.fileupload-ui.js"></script>
    <script type="text/javascript" src="libraries/blueimp/js/main.js"></script>

解决方案

if you are customizing the interface you should check out this link on setting minimalistic interface with custom upload progress bar . . . .

The plugin adds custom spans with custom classes to display selected files and prepare them for upload . . . .

for eg . . check this source of blueimp demo

 <!-- The table listing the files available for upload/download -->
    <table role="presentation" class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>

I suggest you to check out the documentation which is very detailed . . .

这篇关于无法让jquery文件上传器出现在页面上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆