Archive for 'ajax'


Promemoria in stile MacOS X con jQuery e PHP!

Posted on 31. Jan, 2010 by daniele.

0

Questo script PHP e jQuery darà ai visitatori la possibilità di creare note con un'anteprima in tempo reale e di spostarle sullo schermo. Ogni movimento verrà salvato nel database tramite AJAX.

Link: http://tutorialzine.com/2010/01/sticky-notes-ajax-php-jquery/

Continue Reading

Realizzare la chat di Facebook con jQuery e CSS

Posted on 14. Jan, 2010 by daniele.

0

Grazie a questo tutorial imparerete a realizzare la parte grafica della chat del Social Network più famoso al mondo, utilizzando jQuery e CSS!

Link  Parte 1: http://www.sohtanaka.com/web-design/facebook-style-footer-admin-panel-part-1/

Link Parte 2: http://www.sohtanaka.com/web-design/facebook-style-footer-admin-panel-part-2/

Demo: http://www.sohtanaka.com/web-design/examples/footer-panel/

Continue Reading

Controllare il blocco popup in Javascript

Posted on 13. Jan, 2010 by daniele.

0

Diversi siti web utilizzano fastidiose finestre popup. Il problema è che alcune persone hanno il blocco popup, ma non lo sanno, in tal modo la nuova finestra non si apre. Ovviamente il browser avvisa l'utente, ma non è sempre così evidente come dovrebbe essere. Ecco un metodo rapido per verificare se la finestra popup è stata bloccato.

 
var windowName = 'userConsole';
var popUp = window.open('/popup-page.php', windowName, 'width=1000, height=700, left=24, top=24, scrollbars, resizable');
if (popUp == null || typeof(popUp)=='undefined') {
	alert('Please disable your pop-up blocker and click the "Open" link again.');
}
else {
	popUp.focus();
}
 

Fonte: http://davidwalsh.name/popup-block-javascript

Continue Reading

Un modo semplice per selezionare tutte le checkbox con jQuery!

Posted on 09. Jan, 2010 by daniele.

0

Grazie a questo tutorial imparerete come selezionare / deselezionare tutte le checkbox presenti in un fieldset.

 
<fieldset>
	// these will be affected by check all
<div>
<input type="checkbox" id="checkall"/> Check all</div>
<div>
<input type="checkbox"/> Checkbox</div>
<div>
<input type="checkbox"/> Checkbox</div>
<div>
<input type="checkbox"/> Checkbox</div>
</fieldset>
<fieldset>
	// these won't be affected by check all; different fieldset
<div>
<input type="checkbox"/> Checkbox</div>
<div>
<input type="checkbox"/> Checkbox</div>
<div>
<input type="checkbox"/> Checkbox</div>
</fieldset>
<fieldset>
</fieldset>
 

Continue Reading

Salvare file al volo con jQuery e FLash 10

Posted on 13. Dec, 2009 by daniele.

0

Flash 10 ha introdotto la possibilità di effettuare una salvataggio all'interno del vostro Pc. Lo script che vi proponiamo oggi permette di salvare file al volo grazie a jQuery e Flash 10

Link: http://downloadify.info/

Continue Reading

Utilizzare jQuery e PHP per leggere i contenuti di un sito web!

Posted on 01. Dec, 2009 by daniele.

0

Spesso mi mandate email chiedendomi come caricare una pagina presente in un altro dominio. Oggi esaudirò la vostra richiesta utilizzando PHP e jQuery!
PHP

$ch = curl_init("http://www.google.it/");
$html = curl_exec($ch);
echo $html;

JAVASCRIPT / JQUERY

$("document").ready(function() {
$("#content").load("curl.php");
});

HTML

 
<h1>Smashing Community News</h1>
<div id="content"><img src="ajax-loader.gif" alt="Loading..." /></div>
 

Continue Reading

Utilizzare ajax e PHP per realizzare una ricerca in tempo reale!

Posted on 20. Nov, 2009 by daniele.

0

In questo tutorial useremo jQuery per eseguire una ricerca su una tabella MySQL, senza attendere il caricamento di una nuova pagina. Prima di tutto costruiremo il documento PHP che sarà utilizzato da jQuery per eseguire la ricerca e poi ci occuperemo di realizzare la parte html per rendere l'interfaccia user-friendly.

 
$link = mysql_connect("localhost","root","");
mysql_select_db("td_search", $link);
 
$keywords = mysql_real_escape_string( $_POST["keywords"] );
 
$query = mysql_query("SELECT * FROM `wp_posts` WHERE `post_content` LIKE '%". $keywords ."%' && `post_status` = 'publish'");
 
$arr = array();
while( $row = mysql_fetch_array ( $query ) )
{
	$arr[] = array( "id" => $row["ID"], "title" => $row["post_title"], "content" => $row["post_content"] );
}
 
echo json_encode( $arr );
 
 
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 
<title>TutDepot Search Demonstration</title>
 
<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js"></script>
 
<script type="text/javascript">
	$(document).ready(function(){
		$(".search").click(function(){
			$.post("search.php", { keywords: $(".keywords").val() }, function(data){
				$("div#content").empty()
				$.each(data,…

Continue Reading