Category 'Javascript'


Anonymous functions

I was asked what the advantage or disadvantage in the use of anonymous functions or inline (or onfly), used heavily in Javascript, and now with 5.3, also in PHP.
An inline function, or anonymous because he has not - in fact - a name, is a quick way to write some procedures, indenting tree sequences callback example. Almost all languages ​​support functions of this writing, to limit each with its peculiarities and restrictions. They may also have different names and syntax details, such as the so-called blocks in Objective-C.

More ...

WordPress 3.3: jQuery all finally

With WordPress 3.3 also jQuery and all its modules have been aligned. Now it is possible to access the new list of modules in the latest release 3.3, such as the autocomplete. Here's a snippet for a good inclusion:

1
2
3
4
5
6
/ / Load modules that WordPress for us preparatory to the script "MyScript.js"
array ( 'jquery-ui-slider' , $ Deps = array ('jquery-ui-slider',
'Jquery-ui-datepicker',
'Jquery-ui-autocomplete'
);
, 'js/myscript.js' , $deps , 1 . 3 . 4 , true ) ; wp_enqueue_script ('key', 'js / MyScript.js', $ deps, 1. 3. 4, true);

More ...

Bug Fixed: on calendar year range jQuery UI

The calendar widget for jQuery UI , the so-called DatePicker , allows many settings, including the one to decide a range of years to display in the dropdown menu.

More ...

Very short trick: log JavaScript objects

If you are to develop in an environment where it is impossible to use debugging tools like FireBug , such as the Apple iPhone simulator in Xcode, it can become frustrating to find problems, including an incorrect access to all the properties of an object. Here the use of works alert() is fundamental!

More ...

PhpStorm 2.0

PHP IDE dedicated to the development there are many, ranging from free to paid ones. For a long time I have used tools such as Eclipse or Aptana , coming to serve a specialized editor with HTML / Javascript, and - even - CSS. For a year now, however, I think I found definitivamento a complete environment that, at least in my case, it solves all my problems: PhpStorm .

More ...

jQuery snippets

Verify the existence of an element in the DOM

It would happen that it must establish the existence of an element of the DOM. With jQuery could be spontaneously try:

More ...

Very short snippet: slideshow 10 lines of code

Let me demonstrate how you can implement a simple Slideshow of images with very few lines of code, using jQuery .
This technique can be implemented on any type of Web site, the important thing is to include the library jQuery . I used this technique to a site built in WordPress , developed in a few hours for an event.

More ...

Very short snippet: how to identify calls Ajax in PHP

When building an Ajax Gateway, ie a file that is invoked by the object XmlHTTPRequest JavaScript, you can inadvertently create a tunnel for unwelcome intrusion. In fact, being a file like the others, located on our server is reachable from the address bar of your browser.

More ...

How to select a group of tags that have no children of a certain type

jQuery is up to version 1.4! In addition to several new features and the "usual" rewrite of the code, all documentation has been revised so really more readable than before. impostato a _blank ! But we see the question of this post; problem: add, using jQuery, a class to all tags a possessing the attribute target set to _blank !

More ...

Commodore 64 emulator JavaScript

A little 'time ago I reported a version of a Commodore 64 emulator written in Adobe ActionScript 3.0, now in a new version :

Commodore 64 Emulator in Adobe Flash

More ...



Stop SOPA