background preloader


Facebook Twitter

JavaScript Regular Expressions methods and usage. Regular Expressions methods and usage Now, knowing how a RegExp is written is only half the game.

JavaScript Regular Expressions methods and usage

To gain anything from them you have to know how to use them too. There are a number of ways to implement a RegExp, some through methods belonging to the String object, some through methods belonging to the RegExp object. Whether the regular expression is declared through an object constructor or a literal makes no difference as to the usage. JavaScript Kit- RegExp (regular expression) object. Updated: June 27th, 2011 Regular expressions are a powerful tool for performing pattern matches in Strings in JavaScript.

JavaScript Kit- RegExp (regular expression) object

You can perform complex tasks that once required lengthy procedures with just a few lines of code using regular expressions. Regular expressions are implemented in JavaScript in two ways: Literal syntax: //match all 7 digit numbers var phonenumber= /\d{7}/ Dynamically, with the RegExp() constructor: Programmation JavaScript/Notation JSON. Un livre de Wikilivres.

Programmation JavaScript/Notation JSON

La notation objet du langage Javascript JSON (JavaScript Object Notation en anglais) permet de déclarer des objets en donnant la valeur des membres. Cette notation concerne également les tableaux qui sont considérés comme des objets. Elle abrège la déclaration de données en permettant de donner toutes les valeurs d'un objet ou d'un tableau en une seule expression.

Cette expression peut, par exemple, être passée en paramètre d'une fonction. Tableau[modifier | modifier le wikicode] Un tableau est en réalité une forme spéciale d'objet. La syntaxe abrégée pour déclarer le contenu d'un tableau utilise une série de valeurs entre crochets : [ valeur, valeur... ] Où valeur est une expression dont le type peut être quelconque (entier, chaîne de caractères, tableau, objet, ...). JavaScript UI Framework - Ample SDK. How to Submit a Form Using JavaScript. Generally, a form is submitted when the user presses a submit button.

How to Submit a Form Using JavaScript

However, sometimes, you may need to submit the form programmatically using JavaScript. JavaScript provides the form object that contains the submit() method. Use the ‘id’ of the form to get the form object. For example, if the name of your form is ‘myform’, the JavaScript code for the submit call is: Ctrl + Key Combination – Simple Jquery Plugin. In a recent web application I was working on, I had a need for the “Ctrl + S” hotkey to save an entry to the database. Being a an avid jquery fan, I immediately searched the plugin repository for any plugin that fits the bill.

I was not very surprised to find a very comprehensive jshotkeys plugin. It was feature rich and addressed all the requirements for hotkeys in a jquery powered application and obviously my requirement was fulfilled as well. But the basic issue (and advantage too) with any plugin is that it is written for a wide range of audience. So, although my requirement was only for a “Ctrl + key” combination, I had to part with my bandwidth for all other features this plugin offered.

. $.ctrl = function(key, callback, args) { var isCtrl = false; $(document).keydown(function(e) { if(! Regular Expressions: Methods - Doc JavaScript. Javascript / escape(), encodeURI(), encodeURIComponent() The escape() method does not encode the + character which is interpreted as a space on the server side as well as generated by forms with spaces in their fields.

javascript / escape(), encodeURI(), encodeURIComponent()

Due to this shortcoming and the fact that this function fails to handle non-ASCII characters correctly, you should avoid use of escape() whenever possible. The best alternative is usually encodeURIComponent(). The best resource for PHP tutorials, templates, PHP manuals, content management systems, scripts, classes and more. Introduction: Although the concept isn't entirely new, XMLHttpRequest technology is implimented on more sites now than ever. Compatibility is no longer an issue (IE, Mozilla and Opera all support it), and the benefits to using it are amazing.

There are too many PHP programmers avoiding any work with JavaScript beyond simple form validation, and for good reason. It's difficult to keep several languages proficiently under your belt. But using the XMLHttpRequest object is not as hard as everybody thinks, and you don't need to buy and memorize another reference manual. PHP Input Filter (xss, filter, input filter, inputfilter)

x5s - test encodings and character transformations to find XSS hotspots. Here's a quick tutorial to get you familiar with x5s and how to use it.

x5s - test encodings and character transformations to find XSS hotspots

I'm assuming now that you have Fiddler and x5s installed. Configuration Open Fiddler, go to the x5s tab, click Enable. Type in the Preamble 'pqz'. Check the box to Enable Domain Name Targetting and add the domain ''. You're almost set up! Test Case Configuration Now move to the 'Test Case Configuration' tab, where you'll find all of the test cases x5s will send as character probes. We'll pick one or more from each category to get started.

U+FF1C FULLWIDTH LESS-THAN SIGN from the Transformable test typeU+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE from the Transformable test typeU+0022 QUOTATION MARK from the Traditional test typeU+003E GREATER-THAN SIGN > from the Overlong test typeWe're all set and ready for testing! Interpreting the Results Go to the 'Results' tab, it should be empty because we haven't hit the site to test anything yet. However, let's stay here for a minute and look at the next row. How to capture enter key pressed in a form (JavaScript) - Barattalo.