background preloader

Ajax Image Upload without Refreshing Page using Jquery.

Ajax Image Upload without Refreshing Page using Jquery.
Are you looking for ajax file/image upload and preview without refreshing page using Jquery. I had implemented this ajax form submitting using jquery.form plugin and used Arun Shekar's image cropping PHP code for uploading images. Just five lines of JavaScript code, Using this you can upload files, image and videos. Download Script Live Demo Javascript Code$("#photoimg").live('change',function(){})- photoimg is the ID name of INPUT FILE tag and $('#imageform').ajaxForm() - imageform is the ID name of FORM. index.php Contains simple PHP and HTML code. <form id="imageform" method="post" enctype="multipart/form-data" action='ajaximage.php'> Upload image <input type="file" name="photoimg" id="photoimg" /></form> Sample database design for Users. Users Contains user details username, password, email, profile_image and profile_image_small etc. ajaximage.php Contains PHP code. <? db.php Database configuration file, modify username, password, database and base url values.

Drag and drop Page last changed today This article has been translated into French. Here's a simple accessible drag and drop script. It works with both mouse and keyboard. This is a drag and drop element with position: absolute This is a drag and drop element with position: fixed When the '#' link in the example boxes is activated (either by tabbing to it and hitting Enter or by clicking on it) the element can be dragged by the arrow keys. Copy the dragDrop object you find below on this page. You should set two properties. keyHTML contains the HTML of the keyboard-accessible link that every draggable object needs. keySpeed gives the speed of the keyboard drag and drop, in pixels per keypress event. There are seven more properties, but they're all internal to the script. Copy this object to your page (and don't forget the addEventSimple and removeEventSimple functions). A drag and drop is a way of moving an element across the screen. In addition, accessibility must be considered. default: return true; }

Ajax Upload - ZURB Playground - ZURB.com You're going to need jQuery and the AJAX Upload jQuery plugin. Link them up, make sure jQuery is loaded first. Here is the JavaScript we're going to add in its entirety. You can also see it if you view the source of this page. Now let's break it down. First we attach the the AjaxUpload behavior to our file form element. new AjaxUpload('imageUpload', { Next we specify where we want to post the AJAX upload to. action: $('form#newHotnessForm').attr('action'), Set the name of the file form element that will be posted to your server. Add a class to your preview div to indicate that the image is uploading. onSubmit: function(file, extension) { $('div.preview').addClass('loading'); }, When the image has been uploaded we need to do two things. We avoid this problem by waiting to remove the loading class until after the preview image's load event fires. onComplete: function(file, response) { thumb.load(function(){ $('div.preview').removeClass('loading'); thumb.unbind(); });

Cross Browser HTML5 Drag and Drop Updates: May 10, 2013: This article has been translated into Serbo-Croatian language by Anja Skrba from Webhostinggeeks.com.Feb 3, 2009: A bug in Webkit seems to be the culprit in the permissions form example below not working correctly in Safari 4. The code has been updated to work around this bug and the article below has been updated. Thanks to russbuelt for pointing this out.Feb 3, 2009: Apparently, an example made by Apple which I reported not working in Safari does work in Safari 4.0.4 for Mac OS X. Thanks for Scott Straker for this information. Image Credit: Flickr user svartling HTML5 Drag and Drop has been talked about a lot lately, but it’s hard to find really useful information about implementing it across multiple browsers. When normal people see the author of the Compatibility Master Tables respond negatively to a web technology, they would probably assume it would be a good sign to stay away from it. However, I am not normal. See an example of HTML5 Drag and Drop in action.

Jeditable - Edit In Place Plugin For jQuery Hi! My name is Jeditable and I am inplace editor plugin for jQuery. With few lines of JavaScript code I allow you to click and edit the content of different html elements. I am based on Dylan Verheul’s editable. For those in hurry download latest source or minified. How does in place editing work? Normal flow is this. Basic usage While reading you might also want to check live demo. <div class="edit" id="div_1">Dolor</div><div class="edit_area" id="div_2">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. There is only one mandatory parameter. Code above does several things: Elements with class edit become editable. Not bad for oneliner, huh? Elements with class edit_area will use textarea as input. These two examples cover most of needs you usually have. What is sent to server? When submitting change following data will be POST:ed to server: id=elements_id&value=user_edited_content But wait! Demo

Drawing Routes onto MKMapView Using Unofficial Google Maps Directions API « iPhone/iPad geeks world As a startup you should use the great component named MKMapView that already exists in IPhone SDK since the version 3.0.0. It is so easy to implement some map related requirements with this useful component as long as you need to draw routes between two locations. Yes, the MkMapView component is great but if it would have got a directions support it should be a perfect piece of the SDK. You already know that the built-in Google Maps applications on IPhone has the directions support somehow but the feature lacks on the MKMapView component. To have the work done, two problems must be solved. First thing is how to obtain route drawing data, and the second one is that if we found one how we should visually draw it onto the map. Anyway, according to Google Mapki we could grab routing data between two locations by requesting the url below with a parameter set which are lean and mean. The parameters are self explaning saddr: Source location’s latitude and longtitude

jQuery Timeline Plugins When you think of a timeline, you will likely think of Facebook and the introduction of “Timeline” to the wall of their social network. A timeline is a simply way to display a list of occasions or events in chronological order. With many of the jQuery Timeline Plugins and Scripts listed here, you can easily add beautiful, interactive timelines to your web project. Among the many uses, a thoughtfully placed timeline can be a great way for a business to present their history, their development in number of employees, strategic client wins etc. With this collection I will show you some of the best, most useful jQuery Timeline Plugins and Scripts for creating powerful interactive timelines. Melon HTML5 – jQuery Timeline Plugin Melon jQuery Timeline allows you to easily setup a Facebook like timeline on your website. Tweet Feed | Twitter jQuery Timeline Plugin Tweet Feed is a jQuery Timeline Plugin is a fantastic WordPress widget for displaying a Twitter Timeline in real time.

Custom File Inputs with a Bit of jQuery | Viget Inspire File inputs are notorious for being a pain to style across all browsers. In the following image, you can see the difference between the default file inputs in the major browsers: That's pretty gross. For a recent project, the comp had a form to allow users to upload a photo, but the button was completely custom. What followed was some CSS trickery and a bit of jQuery to make the input a little more functional. Starting Simple Let's start by wrapping the file input in a span, and adding an additional span to hold the text for our custom button: <span class="file-wrapper"> <input type="file" name="photo" id="photo" /> <span class="button">Choose a Photo</span></span> Then, let’s add a little CSS to the wrapper span: While we are in the CSS, let’s just style our custom button: Choose a Photo Now, let’s deal with the actual input by absolutely positioning it and assigning it a height: Getting a Little Tricky So now the file input is sitting on top of our “custom button”. Ohh, now that is fun!

HTML5 File Uploads with jQuery Martin Angelov Today we will be developing a small web application called Upload Center, that will allow people to upload photos from their computers by dragging and dropping them onto the browser window, possible with the new HTML5 APIs exposed by modern browsers. The photos will have a preview and a progress bar, all of which controlled on the client side. Currently, the photos are only stored in a folder on the server, but you could improve it any way you like. What are HTML5 File Uploads? Uploading files using HTML5 is actually a combination of three technologies – the new File Reader API, the also new Drag & Drop API, and the good ol’ AJAX (with the addition of binary data transfer). The user drops one or more files from their file system to the browser window by dragging. Sounds complicated? Currently file uploads work only in Firefox and Chrome, but upcoming major versions of the other browsers also include support for it. So lets get started! The HTML index.html <! The jQuery Code

route-me/route-me - GitHub Redactor WYSIWYG html editor by James Fenimore Cooper Winding its way among countless islands, and imbedded in mountains, the "holy lake" extended a dozen leagues still further to the south. With the high plain that there interposed itself to the further passage of the water, commenced a portage of as many miles, which conducted the adventurer to the banks of the Hudson, at a point where, with the usual obstructions of the rapids, or rifts, as they were then termed in the language of the country, the river became navigable to the tide.​ "Come," he said, with a good-humored smile; "the buck that will take to the water must be headed, and not followed." The route taken by Hawkeye lay across those sandy plains, relived by occasional valleys and swells of land, which had been traversed by their party on the morning of the same day, with the baffled Magua for their guide.

Related: