Search Results

Search found 7 results on 1 pages for 'valums'.

Page 1/1 | 1 

  • calling Valums Ajax uploader from other DOM element

    - by Marc
    I'm facing a problem with the valums Ajax File upload. Since the plugin is working perfectly after a few modifications on the server side, I cannot implement a specific behavior. My DOM is composed with an input file plus the container to instantiate the fileuploader buttons. What I want is to be able to fire the fileuploader plugins when clicking on the input:file[name="upload-file"]. ... <div id="upload-accepted"> <fieldset> <label for="upload-file">Select a file:</label> <input type="file" name="upload-file" id="upload-file"/> <noscript> <p>Please enable JavaScript to use file uploader.</p> </noscript> </fieldset> <div id="upload-container"> </div> </div> ... <script type="text/javascript"> $(function() { var uploader = new qq.FileUploader({ action: '/file-upload', element: document.getElementById('upload-container'), onSubmit: function(id, filename){...}, onComplete: function(id, fileName, responseJSON){...} }); }); </script> I have tried to add the following on the script but it don't works $("#upload-file").live('change', function(event) { event.preventDefault(); $('.qq-upload-button').trigger('click'); return false; }); Any clues? Thanks in advance!

    Read the article

  • Ajax Upload using valums ajax upload plugin inside a form.

    - by idrish
    Hi , i just came across this ajax upload plugin and i wish to use it inside a form as shown in the demo page example 3. For some reason i am not able to make it work. I am not sure what parameters come into the function. For example here is my sample code. $(document).ready(function(){ var upload = new AjaxUpload('property_i', { action: 'submitproperty.php', autoSubmit: false, onSubmit : function(file , extension){ return false; } }); var upload_data = upload.setData({ 'propertytype':'propertytype' }); }); Now the ID used in the AjaxUpload function should be ID of the or of the Entire form. Also how do i use setData method. Any suggestions or links will be very helpful. Thanks

    Read the article

  • ajax upload cannot process JSON response or gives download popup

    - by Jorre
    I'm using the AJAX plugin from Andris Valums: AJAX Upload ( http://valums.com/ajax-upload/ ) Copyright (c) Andris Valums It works great, except for the fact that I cannot send proper JSON as a response. I'm setting the headers to 'Content-Type', 'application/json' before sending the JSON-encoded response, and in the plugin I'm saying that I'm expecting JSON: responseType: "json", This gives me a download popup asking to download the JSON/REPONSE file. The strange thing is, when I don't ass the correct "Content-Type" to my response, it works. Of course I want to pass the correct response type, because all my jQuery 1.4 calls are depending on correct JSON. Does anyone else have had this same problem or is there anyone out there willing to try this out ? I'd love to use this plugin but only when I can return proper JSON with the correct content-type Thanks for all your help!

    Read the article

  • Question about functional OOP style in JavaScript

    - by valums
    I prefer to use functional OOP style for my code (similar to the module pattern) because it helps me to avoid the "new" keyword and all problems with the scope of "this" keyword in callbacks. But I've run into a few minor issues with it. I would like to use the following code to create a class. namespace.myClass = function(){ var self = {}, somePrivateVar1; // initialization code that would call // private or public methods privateMethod(); self.publicMethod(); // sorry, error here function privateMethod(){} self.publicMethod = function(){}; return self; } The problem is that I can't call public methods from my initialization code, as these functions are not defined yet. The obvious solution would be to create an init method, and call it before "return self" line. But maybe you know a more elegant solution? Also, how do you usually handle inheritance with this pattern? I use the following code, butI would like to hear your ideas and suggestions. namespace.myClass2 = function(){ var self = namespace.parentClass(), somePrivateVar1; var superMethod = self.someMethod; self.someMethod = function(){ // example shows how to overwrite parent methods superMethod(); }; return self; } Edit. For those who asked what are the reasons for choosing this style of OOP, you can look into following questions: http://stackoverflow.com/questions/1557386/prototypal-vs-functional-oop-in-javascript http://stackoverflow.com/questions/383402/is-javascript-s-new-keyword-considered-harmful

    Read the article

  • How to get value of a input field in Javascript

    - by gaurav.mishra280295
    I am using valums-file-uploader plugin. It allows me to upload files using ajax. I have a problem with it. I have the following script- <input type="text" id="Gaurav" name="Gaurav" /> <script src="fileuploader.js" type="text/javascript"></script> <script> function createUploader(){ var uploader = new qq.FileUploader({ element: document.getElementById('file'), action: 'do-nothing.php', params:{param: document.getElementById('Gaurav').value}, allowedExtensions: ['jpg', 'jpeg', 'png', 'gif'], minSizeLimit: 1, debug: false }); } // in your app create uploader as soon as the DOM is ready // dont wait for the window to load window.onload = createUploader; </script> In it, I want to set the value of param entered by the user. The code is working properly for default value of Gaurav, but didn't work for user inputted value.

    Read the article

  • [jquery] editableText plugin enabling problem

    - by noName
    Hi, I've been experimenting with this plugin http://valums.com/edit-in-place/, so far so good... But i ran into this problem. I want to update my page when update or new request to save data is sent but if i update this function(edit-in-place) it will add second set of buttons, third, fourth and so on. How could i tell it that it would update just on that returned data, but not all elements? I have an idea it has to do something with each function of jquerys, but I'm not sure as I'm quite new to jquery. Thanks for any help!

    Read the article

  • live image edit , and crop

    - by 422
    I was just thinking, which is always dangerous. We use Valums Image uploader. Aside from that, I am looking for an inline image editor, but with a difference. User uploads an image ( lets say 800 x 600 ) Our system wants to see the image ( 170 x 32 ) now I know we can use php to resize images. But I was thinking, does anyone know of a system, where we can display the image, and user can scale, and crop image ( with say a predefined overlay ) By that they scale down to nearest acceptable size, and then click crop tool, which shows a div overlay with say 70% transparency that they can drag over the image, and then click crop. So image is cropped to exact size we need, then can save . I am sure I have seen some jquery stuff done like this, just cannot for life of me find it. Essentialy, we would like to offer a simple client side image processor, thats lightweight, and then the ability to save what they did . Sorry no code to show, as its more of a request. Regards

    Read the article

1