Check if a form has changes before unload the page




File upload by ajax with Laravel and jQuery

Some Controller method in Laravel 4.2, with some JSON responses:

Some jQuery code, which handles the form submit and the results of the upload. Additionally we have notifications for the user.


notify user for unsaved changes

This script notifies the user before he leaves the page for unsaved changes. It fires at the page unload event and opens a special alert box. The user can now decide if he wants to proceed or cancel.


creating an on page search with jQuery

The mission is to create an on page search with jQuery on a table of elements. The search only display rows with the given search term in it. All other rows are hidden.

This is a quick prototype:

The markup


The JavaScript

This code is case insensitive and also removes all tags and newlines.

jQuery: add a class, wait some time and remove it again

This technique, combined with Animate.css or CSS3 Transitions will give you some nice effects:

Add a CSS class to an element, wail till the transition is finished, and then remove the class.