Category: ajax

Autocompletamento con php e ajax

In questo tutorial vedremo come realizzare uno script per l’autocompletamento in ajax che prende i valori da un database

Come prima cosa dobbiamo scaricare l’ultima versione della libreria javascript script.a.culos qui 

Scarichiamo e mettiamo come codice

<script language="JavaScript" SRC="lib/prototype.js"></script>
<script language="Javascript" src="javascript/scriptaculous.js"> </script>
<script language="Javascript" src="javascript/effects.js"> </script>
<script language="Javascript" src="javascript/controls.js"> </script> 

Inserite le librerie necessarie al funzionamento dello script, inseriamo la parte di codice che gestisce il campo da autocompletare

<input type="text" id="search" name="search" />
<div id="hint"></div>
<script type="text/javascript">   
new Ajax.Autocompleter("search","hint","fillfield.php");
</script>

Il file fillfield.php è il file che mostrerà tutte le possibili parole che possono essere utili al completamento del campo

<?php
// cambia le impostazioni per …

ajax edit in place

inwriter è una libreria javascript piccola che ti permette di gestire facilmente l’evento edit in place. Oppure un ottimo tutorial in italiano  http://free-script.it/post/Script_ajax_Edit…loco-38.htm

Sito web: http://digitalhymn.com/argilla/inwriter/

Una serie di links a video tutorials

The JavaScript Programming Language (by Douglas Crockford)
Yahoo! JavaScript Architect Douglas Crockford provides a comprehensive introduction to the JavaScript Programming Language in this four-part video:

  • JavaScript Video Lecture Part I (Yahoo Video)
    JavaScript, aka Mocha, aka LiveScript, aka JScript, aka ECMAScript, is one of the world’s most popular programming languages. Virtually every personal computer in the world has at least one JavaScript interpreter installed on it and in active use. JavaScript’s popularity is due entirely to its role as the scripting language of the WWW. Despite its popularity, few know that JavaScript is a very nice dynamic object-oriented general-purpose programming language. How can this be a secret? Why is this

Tutorials su ajax

Getting Started  

  1. An Ajax Hello World project to Get You Going : First program at Mike On Code   
  2. Rasmus 30 second AJAX Tutorial : first program using Ajax at CoderLab   
  3. Instant Tutorial : Quick tutorial at AleemBawany   
  4. Ajax Toybox : Simple first programs including, Hello, World, Dynamic City, State Lookup, Ajax to Clean Your Clock, Ajax Calculator and an RSS News Ticker.   
  5. A simple Ajax example : a simple program demo for Ajax at MD Groves   
  6. Ajax Toolbox / XMLHttpRequest AjaxRequest Library Examples : Ajax examples including Error Handling, Time Out, Simultaneous Requests, Activity Monitoring, Form Submittal, Event Handlers, Queued Requests, Request Parameters   
  7. An Introduction to Ajax : introduction

Login con php e ajax

In questo articolo vedremo come creare un sistema per creare un sistema di login sicuro usando XMLHttpRequest. Questo esempio è un sistema per il login che nn richiede il refresh della pagina ma veramente sicuro.

Vantaggi
User does not need to refresh the page to login.
User is notified instantly on incorrect username/password combination.
Overall user experience is more seamless.
Password is not sent in plain text ever (more secure than traditional system).
Javascript convenience with server-side security (uses PHP/MySQL).
Uses one-time use random seed to hash the password before sending (making interceptions useless).

Svantaggi
System is more prone to brute force attacks.
Can be minimized by adding a delay …

Corso ajax online di 18 settimane

Sul sito http://www.javapassion.com/ajaxcodecamp/index.html cè un corso gratuito di ajax online da Sang Shin, sang.shin@sun.com, Sun Microsystems, www.javapassion.com/ajaxcodecamp.

Realizzare un carrello elettronico con drag e drop e ajax

In questo articolo vedremo come realizzare uno script per il carrello elettronico con drag e drop e ajax.

Link: http://br.sys-con.com/read/172585_1.htm

Transizione per effetti di animazione

The first most common mistake is to do all animation effects at a constant speed. For many types of effects, linear/constant speed animation looks clunky because the animation starts and stops and so abruptly. The solution is to adjust the speed of the animation based on a sinusoidal curve rather than a line so that the transition looks smoother — basically, it should start slow and end slow and speed up in the middle.

The second most common mistake is to do all animation at a constant frame rate. Given the dramatic DOM performance differences between web browsers and operating systems, an animation with a constant number of frames can …

PHP AJAX asynchronous file upload

L’upload di file asynchrono è uno delle richieste maggiori nelle applicazioni web basate su ajax. La classe standard di AJAX (XmlHttpRequest) non ha la capacità di processare p inviare file da una finestra di dialogo (input type="file"). Questo articolo contiene un esempio du applicazione (trivial file-sharing service, come rapidshare, megaupload o yousendit) che usa embedded frames (IFRAME) per l’upload di file. Mentre un file è uplodato nel frame hidden ,l’utente puo accedere ala pagina web.

http://www.anyexample.com/programming/php/php_ajax_example__asynchronous_file_upload.xml

Eventi javascript usati con ajax

  • onabort Occurs when the user aborts an action
  • onblur Occurs when an element loses the input focus
  • onchange Occurs when data in a control, such as a text field,changes
  • onclick Occurs when the user clicks an element
  • ondblclick Occurs when the user double-clicks an element
  • ondragdrop Occurs when the user drags and drops an element
  • onerror Occurs when there’s been a JavaScript error
  • onfocus Occurs when an element gets the focus
  • onkeydown Occurs when the user presses down on a key
  • onkeypress Occurs when the user presses a key
  • onkeyup Occurs when the user releases a key
  • onload Occurs when the page loads
  • onmousedown Occurs when the user presses down

Le proprieta dell’oggetto XMLHttpRequest

• onreadystatechange
– Event handler that fires at each state change
– You implement your own function that handles this
• readyState – sato corrente della richiesta
– 0 = uninitialized
– 1 = loading
– 2 = loaded
– 3 = interactive (some data has been returned)
– 4 = complete
• status
– HTTP Status ritornato dal server: 200 = OK
• responseText
– String version dei dati ritornati dal server
• responseXML
– XML DOM document dei dati ritornati
• statusText
– Testo dello status ritornato dal server…

Condividi





Booking online




Categorie