I keep getting the following error in the console.
Uncaught TypeError: $(...).plupload is not a function
I am trying to setup a WordPress front end page where logged in users can upload images.
There seems to be something that is blocking this script. It's making me crazy!
It is enqueued. I have function that verifies it is loaded.
This function produces these js that are enqueued.
I can't even get the generic basic setup to load.
Here is what I have pasted into the template file for this page.
I'm new to using plupload and there has to be something that the start up guide isn't saying. However, the wordpress specific stuff is thin.
Please let me know what I am missing or how I can get this to load? It is on a test server so I can't give a URL.
I know some of the configuration stuff within is not correct but it should still fire plupload.
Thanks so much for your help!
Uncaught TypeError: $(...).plupload is not a function
I am trying to setup a WordPress front end page where logged in users can upload images.
There seems to be something that is blocking this script. It's making me crazy!
It is enqueued. I have function that verifies it is loaded.
Code:
function my_detected_scripts() {
global $wp_scripts;
foreach( $wp_scripts->queue as $handle ) :
echo $handle . ' <br /> ';
endforeach;
}
echo my_detected_scripts();
This function produces these js that are enqueued.
Code:
ssmemberships_js
jquery
q-a-plus
puzzle_reload
solvemedia_comment_reply
parallax
modernizr
carousel
tipsy
fields
tabs
jquery_scroll
supersubs
superfish
hoverIntent
buttons
ddslick
main
googlemaps
gmap
bootstrap
ubermenu
admin-bar
plupload-all
plupload
jquery-ui-core
jquery-ui-widget
jquery-ui-button
jquery-ui-progressbar
jquery-ui-sortable
jquery-ui-tabs
jquery-ui-autocomplete
jetpack-photon
ngg_lightbox_context
recaptcha
tml-themed-profiles
devicepx
grofiles-cards
wpgroho
wp-jquery-lightbox-swipe
wp-jquery-lightbox
wpcom-notes-admin-bar
I can't even get the generic basic setup to load.
Here is what I have pasted into the template file for this page.
Code:
<h1>jQuery UI Widget</h1>
<p>You can see this example with different themes on the <a href="http://plupload.com/example_jquery_ui.php">www.plupload.com</a> website.</p>
<form id="form" method="post" action="/echo/json">
<div id="uploader">
<p>Your browser doesn't have Flash, Silverlight or HTML5 support.</p>
</div>
<br />
<input type="submit" value="Submit" />
</form>
<script type="text/javascript">
$(document).ready(function() {
$("#uploader").plupload({
// General settings
runtimes: 'html5,flash,silverlight,html4',
// Fake server response here
// url : '../upload.php',
url: "/echo/json",
// Maximum file size
max_file_size: '1000mb',
// User can upload no more then 20 files in one go (sets multiple_queues to false)
max_file_count: 20,
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 : 'http://rawgithub.com/moxiecode/moxie/master/bin/flash/Moxie.cdn.swf',
// Silverlight settings
silverlight_xap_url : 'http://rawgithub.com/moxiecode/moxie/master/bin/silverlight/Moxie.cdn.xap'
});
// Handle the case when form was submitted before uploading has finished
$('#form').submit(function(e) {
// Files in queue upload them first
if ($('#uploader').plupload('getFiles').length > 0) {
// When all files are uploaded submit form
$('#uploader').on('complete', function() {
$('#form')[0].submit();
});
$('#uploader').plupload('start');
} else {
alert("You must have at least one file in the queue.");
}
return false; // Keep the form from submitting
});
});
</script>
I'm new to using plupload and there has to be something that the start up guide isn't saying. However, the wordpress specific stuff is thin.
Please let me know what I am missing or how I can get this to load? It is on a test server so I can't give a URL.
I know some of the configuration stuff within is not correct but it should still fire plupload.
Thanks so much for your help!