jquery.uploadify.v2.1.4.js
jquery.uploadify.js
我要在同一个页面中同时使用这2个JS插件,但后引用的那一个可以正常上传,另外一个却不行。
<script src="../CommonFiles/Scripts/jquery-1.7.1.min.js" type="text/javascript"></script> <script src="../CommonFiles/Scripts/JqueryUpload/jquery.uploadify2.v2.1.4.js" type="text/javascript"></script> <script type="text/javascript"> var imgJQuery = $.noConflict(true); </script> <div class="uploadImg"> <img id="upPhoto" src="../CommonFiles/Scripts/JqueryUpload/DefaultPhoto.gif" /> </div> <div> <input id="FileImg" name="FileImg" type="file" style="width: 150px;" class="inputStyle2" /> </div> <div id="fileImgDiv" style="display: none;"> <asp:TextBox Style="display: none;" runat="Server" ID="txtImg"></asp:TextBox> <input type="file" runat="Server" id="Image"/> <input runat="Server" class="textbox" id="hidImg" style="display:none;" /> </div> <script src="../CommonFiles/uploadify/jquery.uploadify.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { var photoName = ""; var b = new Date(); var ymd = b.getFullYear() + "-" + (parseInt(b.getMonth()) + 1) + "-" + b.getDate(); imgJQuery('#FileImg').uploadify({ uploader: '../CommonFiles/Scripts/JqueryUpload/uploadify.swf', script: '../Ajax/FileUploadHandler.ashx',<!-- 无法进入到该处理类中 --> cancelImg: '../CommonFiles/Scripts/JqueryUpload/cancel.png', folder: '../CommonFiles/UploadImage/tryImg/', queueID: 'fileImgDiv', buttonImg: '../CommonFiles/Scripts/JqueryUpload/photo.gif', fileExt: '*.jpg;*.gif;*.png', fileDesc: '请选择图片文件', sizeLimit: 5120000, width: 100, height: 28, auto: true, scriptData: { 'uploadType': 'temp' }, // 'onSelect': function(event, ID, fileObj) { // photoName = fileObj.name; // }, // 'onError': function() { // alert('Error'); // }, // 'onComplete': function() { // $('#upPhoto').attr('src', "../CommonFiles/UploadImage/tryImg/" + ymd + photoName); // alert('Success'); // }, onInit: function() { alert("OnInit");}, // Function to run when uploadify is initialized onSelect: function(event, ID, fileObj) { photoName = fileObj.name; alert("onSelect"); }, // Function to run when a file is selected onSelectOnce: function() { alert("onSelectOnce"); }, // Function to run once when files are added to the queue onQueueFull: function() { alert("onQueueFull"); }, // Function to run when the queue reaches capacity onCheck: function() { alert("onCheck"); }, // Function to run when script checks for duplicate files on the server onCancel: function() { alert("onCancel"); }, // Function to run when an item is cleared from the queue onClearQueue: function() { alert("onClearQueue"); }, // Function to run when the queue is manually cleared onError: function() { alert("onError"); }, // Function to run when an upload item returns an error onProgress: function() { alert("onProgress"); }, // Function to run each time the upload progress is updated onComplete: function() { alert("onComplete"); }, // Function to run when an upload is completed onAllComplete: function() { alert("onAllComplete"); } // Function to run when all uploads are completed }); }); </script>
从插件命名上看这两个插件都是上传用的吧,只是版本不同,这样的话同名方法会被覆盖的
我就是想,有没有办法解决!~
@小明冥: 只用一个不行吗?
@artwl: 只有一个不能满足要求啊!~