Topic: plupload is undefined

Hope someone can help i'm going crazy tring to work out why this is not working.

i have a page with it working, just the plupload on the page using the jquery ui, exactly as in the example. all good

however when i try to incorporate it into my page it breaks with the following error:
$("#uploader").plupload is not a function
[Break On This Error] flash_swf_url : '/plupload/js/plupload.flash.swf'

anyone else noticed a similar problem??? really need to get this working

Re: plupload is undefined

I think you need to double check urls, of Plupload scripts, and runtimes (flash object) in your case. Looks like it is the case. Let us know, if it's not.

If you want to see your issue fixed, do not report it here, do it on - GitHub.

Re: plupload is undefined

first thing i checked!!! in firebug under the net tab all the scripts are loaded in correctly, is why it makes no sense to me.

the scripts are there and the code is exactly as is in the demo.

must be something conflicting i guess but what i dont know.

am using jquery latest version 1.4.2 there is a lot of other jquery on the page but all that is afyter the code for the plupload and it breaks before reaching that and the page works fine without the plupload code.

i cant give you a test url as its in a password protected area of my clients site.

Re: plupload is undefined

$("#uploader").plupload is not a function
[Break On This Error] flash_swf_url : '/plupload/js/plupload.flash.swf'

"runtimes (flash object) in your case."

i have all the plugins activated it crashes when it reaches the last line of the $('#uploader').plupload block of code, was displaying the silver light as the error before so i removed that line, and so it displays the last line of the code block as the error (now the flash) since i removed the silverlight bit

Re: plupload is undefined

Well... the error you get, basically means that there is a javascript error somewhere, which prevents all other scripts that follow from proper evaluating. Error can be everywhere. Have you tried a clean test case? With nothing other on the page then Plupload instance and required html structures maybe? Also try to run a different runtime, for example HTML4 or HTML5 and check if it does the job.

If you want to see your issue fixed, do not report it here, do it on - GitHub.

6 (edited by DizzyBHigh 2010-12-27 14:11:55)

Re: plupload is undefined

the javascript error tht stops anything else from running is $('#uploader').pluploader is undefined

tried various things but still unable to get it to work, i have a test url for you to look at:
http://rhtest.base5.eu/Client%20Area/cl … loader.php

Re: plupload is undefined

Finally got it working,

was not a problem with pl-upload but another script. took ages to find the problem. i was using jquery cycle on the page which for some reason pl-upload did not like, and still dont know why it didnt like it, thanks for your replys, was starange that the error showed up as a pl-upload error and not in the script for the cycle.

Re: plupload is undefined

@jdcline Plupload isn't slow, really, so it might be specific to your implementation, hence if you are looking for help here you need to describe your usage case in more detail, provide a code, etc.

If you want to see your issue fixed, do not report it here, do it on - GitHub.

Re: plupload is undefined

Hi All,

I am also having the same problem with Joomla version 3.3. I have used code
$document = JFactory::getDocument();     
$document->addScript("js/plupload.full.min.js");       
$document->addScript("/js/mediaUpload.js");

Both the files are getting added to the view.
Content of mediaUpload.js is
jQuery(document).ready(function($){
    $("#uploader").plupload({
        // General settings
        runtimes : 'html5,flash,silverlight,html4',
        //url : "/examples/upload",

        // Maximum file size
        max_file_size : '2mb',

        chunk_size: '1mb',

        // Resize images on clientside if we can
        resize : {
            width : 200,
            height : 200,
            quality : 90,
            crop: true // crop to exact dimensions
        },

        // Specify what files to browse for
        filters : [
            {title : "Image files", extensions : "jpg,gif,png"},
            {title : "Zip files", extensions : "zip,avi"}
        ],

        // Rename files by clicking on their titles
        rename: true,
         
        // Sort files
        sortable: true,

        // Enable ability to drag'n'drop files onto the widget (currently only HTML5 supports that)
        dragdrop: true,
        // Views to activate
        views: {
            list: true,
            thumbs: true, // Show thumbs
            active: 'thumbs'
        },
        // Flash settings
        flash_swf_url : 'components/com_mediamanager/assets/js/setting/Moxie.swf',     
        // Silverlight settings
        silverlight_xap_url : 'components/com_mediamanager/assets/js/setting/Moxie.xap'
    });
});

Which I copied on one of your examples.

I am getting following error:
$(...).plupload is not a function
silverlight_xap_url : 'components/com_mediamanager/assets/js/setting/Moxie.xap'

Could you please help me with it ?

Thanks,
Ankit

Re: plupload is undefined

hi ankitjagetia

sorry but this is probably not going to help you much but i'll say it any way as it was the cause of my problem.

Theres some other javascript on your page thats causing the javascript to error, when this happens, the plupload instance will be undefined, as the javascript stops executing once it hits an error so the plupload scripts do not get run.

All you can do really is to remove plupload from the page and use firebug or something similar to analyze the existing js. and see if there are any  problems with your existing code.

If no problems occur then try running the demo code with php upload on a page on its own, then 1 by 1 add the existing js you have until it breaks, thats pretty much the only way of finding out what other js is causing your conflicts.

It took me a good few hrs, but i found the rough js eventually, good luck.

Re: plupload is undefined

I'm getting the same problem with the latest version (2.1.2).

My existing JavaScript doesn't generate any errors, and all libraries for the project – including plupload.min.js – are concatenated and minified into a single blob via Grunt.

Yet trying to bind $('.my-element').plupload({...}); causes the following console error in Chrome:

Uncaught TypeError: $(...).plupload is not a function

If I manually type plupload into the Chrome console after this error, Plupload does exist and has methods. But I can't seem to bind it onto a jQuery object.

Given that I get no other JavaScript errors from my existing code, I'm completely stuck. Any ideas?

Re: plupload is undefined

@markedup, simply make sure that Plupload is loaded at the moment you try to initialise it. Looks like it is not.

If you want to see your issue fixed, do not report it here, do it on - GitHub.

Re: plupload is undefined

if it could help someone, if you take the example, don't forget to load your_path/plupload/jquery.ui.plupload/jquery.ui.plupload.min.js and css !

In my case, it was that !

14 (edited by riderfx3 2016-06-03 15:57:55)

Re: plupload is undefined

Hello,

Got same problem, and here is the order i load the files to solve it :

<script type="text/javascript" src="js/plupload.full.min.js"></script>
<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="js/jquery-ui.js"></script>
<script type="text/javascript" src="js/jquery.ui.plupload.js"></script>

And it erased all javascript errors wink

Re: plupload is undefined

thanks ankit, your answer to the post were very helpful.

g club