for some reason its not processing-- var user = variable, when i view the results-- mysite.com/image_upload/uploads/';/
(function($){
$.simpleuploader = {version: '0.1'};
$.fn.simpleuploader = function(options){
// the container to inject the form into
var $this = $(this);
var user = '<?php echo json_encode($uid); ?>';
// set defults
var defaults = {
prefix: 'simpleuploader-',
latency: 500,
reuse: true,
when: 'onchange',
submitText: 'Submit',
disabledOpacity: .3,
settings: {
fullPath: 'http://www.mysite.com/image_upload/uploads/' + user + '/',
relPath: '../uploads/' + user + '/',
maxSize: '4194304',
maxW: 300,
maxH: 300,
colorR: 255,
colorG: 255,
colorB: 255
},
json_encode()
produces a javascript object, and that does not belong inside quotes. There is probably a quote or something in your echo
statement that is messing up the javascript. Try changing that line to this.
var user = <?php echo json_encode($uid); ?>;
That being said, json_encode()
on a single variable is bad practice, and a weird way to do something. If the $uid is just a number, why not use:
var user = <?php echo $uid; ?>;