Search Results

Search found 3 results on 1 pages for 'bakazero'.

Page 1/1 | 1 

  • Jquery: how to call the function again?

    - by bakazero
    I'm making the script for easy upload many files. I've tried fyneworks plugin, but the file name does not appear in a form that uses tiny_mce. This is the code: $("document").ready(function () { var i = 0; //iteration for Inputted File var max = 5; //max file uploaded createStatus(); //generate status container $('.imageNow').change(function() { if($(this).val()) { var ext = $(this).val().split('.').pop().toLowerCase(); var allow = [ 'gif', 'png', 'jpg', 'jpeg' ]; if (jQuery.inArray(ext, allow) != -1) { //validation true addImgInput($(this).clone()); $(this).addClass('imgOK'); $(this).removeClass('imageNow'); addImgList($(this).val()); removeImgStatus(); i++; } else { addImgStatus(); $(this).remove(); addImgInput(); } } return false; }); }); This is another function that I use: function addImgInput(inputClone) { $(inputClone).prependTo( $('#upload_images') ); //div container for generated InputFileImg }; function addImgList(listingImg) { $('#list_image_file').append('<li>' + listingImg + '</li>' ); //list all images that have been inputted } function createStatus() { $('#upload_images').append('<small class="status"></small>'); //error display container } function addImgStatus() { $('.status').append('* Wrong File Extension'); //error display text } function removeImgStatus() { $('.status').empty(); } Mmm..yeah is't not finished yet, because when I try to generate another Inputfile with imageNow class, the $('.imageNow').change(function() is not going to work anymore. Does anyone can help me? Thanks

    Read the article

  • how to create Codeigniter route that doesn't override the other controller routes?

    - by bakazero
    I've got a lot controller in my Codeigniter apps, ex: Signup, Profile, Main, etc.. Now I want to build "User" controller. what I want: if people goes to url: example.com/signup, I want use default route to "Signup" Controller if people goes to url: example.com/bobby.ariffin, I want to reroute this to "User" Controller because the url not handled by any Controller in my apps. I had create this in my config/routes.php: $route['(:any)'] = "user/$1"; but it's override all the route in my apps to "User" Controller. Is there any simple route for Codeigniter that doesn't override the other controller routes?

    Read the article

  • How to use Jquery UI in my Custom Function? (Autocomplete)

    - by bakazero
    I want to create a function to simplify configuration of jQuery UI AutoComplete. Here is my function code: (function($) { $.fn.myAutocomplete = function() { var cache = {}; var dataUrl = args.dataUrl; var dataSend = args.dataItem; $.autocomplete({ source: function(request, response) { if (cache.term == request.term && cache.content) { response(cache.content); } if (new RegExp(cache.term).test(request.term) && cache.content && cache.content.length < 13) { var matcher = new RegExp($.ui.autocomplete.escapeRegex(request.term), "i"); response($.grep(cache.content, function(value) { return matcher.test(value.value) })); } $.ajax({ url: dataUrl, dataType: "json", type: "POST", data: dataSend, success: function(data) { cache.term = request.term; cache.content = data; response(data); } }); }, minLength: 2, }); } }) (jQuery); but when I'm using this function like: $("input#tag").myAutocomplete({ dataUrl: "/auto_complete/tag", dataSend: { term: request.term, category: $("input#category").val() } }); It's give me an error: Uncaught ReferenceError: request is not defined

    Read the article

1