Articles with tag 'Ajax'


Very short snippet: how to identify the Ajax calls in PHP

When building a Gateway Ajax, that is, a file that is called by the object XmlHTTPRequest JavaScript, you can inadvertently create a tunnel for intrusions do not like. In fact, given a file like the others, placed on our server, it is also accessible from the browser address bar.

Continued ...

Shadowbox 3.0 beta

It was released just now (thanks to the suggestion of the author Michael JI Jackson ) the 3.0 beta release of Shadowbox.js . In addition to the new design of the website here are the most important changes in this release preliminary:

Continued ...

Overloading

Overloading is a really useful feature of some object-oriented programming languages. However, no tuti OO languages ​​support it, and some of the "implement" or so limited or different. In general, for functions or methods, overloading allows you to create two or more functions / methods that have the same name but accept different parameters, for example:

Continued ...

Very short trick: proxy RSS with SimplePie

If you use Flash or Ajax to read RSS feeds from other domains, you need to equip yourself with a proxy (tunneling) because of the protections imposed by both technologies (see tunneling and proxy server for Ajax and not only ). If your site or blog is already present SimplePie , you can write a simple proxy in this way:

Continued ...

WordPress: step by step how to create their own login

In this tutorial we will see how to create a personal login procedure, also using Ajax functionality using jQuery . ). There are various methods to customize the WordPress login, for example through the use of hook and filters ( add_action() , add_filter() ). We'll use a procedure more low-level, although there anyway to interfacceremo Kernel WordPress. In addition, we will attempt to validate a user through the dupla email / password.

Why create their own login?

  • In some contexts can return uitle have maximum control on the login page, to propose a custom layout to our registered users. You can also enrich the page with useful information, from a logo to the classic "Forgot password?"
  • To allow access via email (as in the example discussed here) instead of user_login standard WordPress
  • To have the opportunity to enter a login panel in the sidebar of our Blog
  • And finally, to have a skeleton - and an idea - for a great Plugin : D

Environment

In our example / tutorial we will work on the root of WordPress in a folder mylogin . . Create two php files within this folder: index.php and logon.php . The first will contain the interface of our log, with all features Javascript / jQuery we need. The second file, logon.php , will contain the code to validate the user. e una cartella images . We then create a folder css and within this file layout.css and a folder images . Inside the images folder insert a classic Ajax loader: create it online at AjaxLoad.info . At the end you should have:

  • mylogin
  • index.php
  • logon.php
  • css
  • layout.css
  • images
  • ajax-loader.gif

Continued ...

Google AJAX Language API: tutorial on the operation

I say, with this post, at the request of Andrea on how to enter the Google translator in the Web. There are several ways to take advantage of machine translation services provided by Google and beyond. We can use Plugin written by third parties, a simple JavaScript script mix by Google itself or learn how to use the API, which is a series of callable functions - as we shall see - in various ways.

Plugin

I will not dwell on this solution, as I believe is not exactly relevant to the request for Andrea , if I understood well. It is also a solution substantially in order applies only to the Blog and not for individual use and generic. I can only report, for users WordPress , Global Translator , perhaps the most simple, practical and widespread Plugin like this.

Script-mix by Google

The easiest way to translate your website or your blog is to add a simple JavaScript script provided by Google itself. Just go to the website translate.google.com and click on the 'Tools' tab. From this page you can preset the translation functions or leave the default. The script is very simple:

1

and as a result is obtained:

Google Translate

Continued ...

2.0 Snipplr code fragments (snipp) of useful code

Snipplr It was a long time that I wanted to point this useful service dedicated to the world of programming. Snipplr (code 2.0) is a veritable font or repository of useful code snippets. You can register for free and submit their portions of code and, more importantly, there are several fine snipp already on site. The languages ​​covered are many (Actionscript, ASP, C #, Matlab, PHP, Rails, SVN, etc ...), all well-ordered and cataloged. You can also install a handy WordPress plugin can display on our blog a snipp-code via its unique id.

Continued ...

Pocketguide the free Adobe AIR for Javascript

image Written directly from the AIR team, this guide is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License , in short, is freely accessible! Despite its simplicity, it contains a lot of interesting (and correct, as it is the AIR team to write them) for developing AIR applications with Javascript, HTML and CSS. Thanks to Ajaxian you can download the text, in PDF format, by clicking here , or - if you prefer - you can order it on Amazon . On Adobe Labs find other useful information.

Continued ...

Shadowbox assetURL: Set the image path

When Shadowbox opens his window to show content (image, iframe, Movie, etc ...), view, waiting, an animated gif that comes in the package. If the page that is using Shadowbox is at the same level as the images folder, everything works fine. By default, in fact, look for the animated gif below Shadowbox images / loading.gif - or images / loading-light.gif if you have chosen the styles light (shadowbox-light.css). Otherwise, and often there is also the risk of not accorgesene, if we are in a different masts, it generates a nice code 404 - page not girder in our case file not found!

To solve the problem just initialize Shadowbox with an appropriate parameter that indicates precisely the absolute path to the images folder: undolog.com of, for example, I placed the animated gif of loading directly into the images folder in this root (how about a billion other sites :) . To make this folder accessible to Shadowbox, regardless of the path, I have included an easy way:

1
2
/ / Init parameter shadowbox with assetURL
assetURL : 'http://www.undolog.com/' } ) ; Shadowbox. Init ({assetURL: 'http://www.undolog.com/'});

Continued ...

All clones Lightbox in a dynamic array

Planetozh has created a beautiful scenery of the dynamic tool can list all the JavaScript libraries like Lightbox.

image

image Using a panel (see image at left) with a series of "ticks" (checkbox), which indicate the various features of the libraries, you can run a filter resulting in a list of one or more libraries that do the job. We hope that the author maintains updated this fantastic page, very useful in disentangle the numerous and ever more powerful libraries of this kind.

Continued ...