background preloader

Jquery

Facebook Twitter

Asp.net mvc - jQuery upload file using jQuery's ajax method (without plugins)

Gallery

Regex. Sélecteur RegExp pour jQuery. Traduction de l’article de James Padlosey : Regex Selector for jQuery. il y a quelques temps, j’ai publié un article (traduction) expliquant combien c’était ultimement génial d’étendre les sélecteurs de filtres de jQuery. En partant de ça, voici quelque chose de nouveau : un sélecteur par expressions régulières. les sélecteurs (CSS 3) d’attributs actuels de jQuery permettent une notation par expressions régulière basique, mais rien qui s’approche de ceci. :regex Utilisation C’est assez simple à utiliser, vous avez besoin de passer un attribut et une expression régulière à tester. // Sélectionne tous les éléments dont l'id commence par une voyelle : $(':regex(id,^[aeiou])'); // Sélectionne tous les divs dont la classe contient un chiffre : $('div:regex(class,[0-9])'); // Sélectionne toutes les balises script dont la source contient jQuery : $('script:regex(src,jQuery)'); // Oui, je sais que le dernier exemple peut être fait avec les sélecteur d'attributs CSS3.

Amusez-vous bien ! Regex - Regular expression field validation in jQuery. Checking if Cookies are Enabled | Sveinbjorn Thordarson. UPDATE: The information contained on this page is ancient and obsolete. Seek counsel elsewhere! One of the uncertainties facing any web developer are the myriad browser configurations of different end-users. Some users may disable cookies due to fear that their personal information is being compromised, while the more security-paranoid may even disable JavaScript.

This can pose a problem for web mechanisms that rely on cookies to store session identification and other neccessary information. Consequently, there may often be occasions where one wishes to check whether an end-user has cookies enabled. In this short article, I discuss the methods that can be used to check whether cookies are enabled, providing code samples. The JavaScript Method The simplest way to check for cookies is via JavaScript. A snippet of code using the function above was executed when you loaded this page.

You have cookies ENABLED One of the disadvantages of the method above is that it requires JavaScript. . #! #! #!

Libraries

Grep. Échange d’objets JSON entre PHP et JavaScript, facile grâce à jQuery – Hooba Studios. UI. Menu. Autocomplete. Jquery Form. jQuery Form Plugin. The following code controls the HTML form beneath it. It uses ajaxForm to bind the form and demonstrates how to use pre- and post-submit callbacks. AJAX response will replace this content.

The following code controls the HTML form beneath it. It uses ajaxSubmit to submit the form. This page gives several examples of how form data can be validated before it is sent to the server. The secret is in the beforeSubmit option. If this pre-submit callback returns false, the submit process is aborted. The following login form is used for each of the examples that follow. Form Markup: <form id="validationForm" action="dummy.php" method="post"> Username: <input type="text" name="username" /> Password: <input type="password" name="password" /> <input type="submit" value="Submit" /> </form> First, we initialize the form and give it a beforeSubmit callback function - this is the validation function. Validate Using the formData Argument Validate Using the jqForm Argument Note Server code injson-echo.php: <?

Upload Button

How to select a radio button with jQuery. A simple example to select a radio button with jQuery dynamically. A radio buttons group, with a name=”sex”. <input type="radio" name="sex" value="Male">Male</input><input type="radio" name="sex" value="Female">Female</input><input type="radio" name="sex" value="Unknown">Unknown</input> 1. To display the selected radio button value. $('input:radio[name=sex]:checked').val(); 2. $('input:radio[name=sex]:nth(0)').attr('checked',true); or $('input:radio[name=sex]')[0].checked = true; 3. $('input:radio[name=sex]:nth(1)').attr('checked',true); or $('input:radio[name=sex]')[1].checked = true; 4. $('input:radio[name=sex]:nth(2)').attr('checked',true); or $('input:radio[name=sex]')[2].checked = true; 5. $('input:radio[name=sex]').attr('checked',false); jQuery select a radio button example.

Slider

TreeView. Code Generator. Jquery4Java. Tutorial. Starting With jQuery - How to Write Custom Validation Rules. This series of posts on using jQuery with no prior knowledge comes to its fifth iteration. Today, I'm going to look more in depth at the Validation Plug-in. We'll be looking at what rules the Validation Plug-in comes with out of the box followed by an example of how to create your own rules. In addition to the typical project that I typically supply, I am also including a list of custom Validations that I have used to hopefully make everyone's life a little easier. If you would like to review the previous posts in this series, please feel free to review the links below: Required Downloads to use the Examples: In order to use the Validation plug-in, you'll need to add a few things to your web page: Code Downloads for this Post: Source Code Download: Starting With jQuery - Custom Validation Rules.zip Just the Rules File: Starting With jQuery - Additional Validation Rules.zip A Look at some of the Built-In Validation Rules: Creating a Custom Validation Rule: Putting it all Together: 7: return !