Daniele Cruciani
Programmatore Developer PHP/MySQL Freelance
mobile: +39 3489215204

icq skype msn linkedin fb t ff youtube picasa google
seconds to the end of World
End of World 21 December, 2012 11:11:00
Hire me before that day! | don't bother

javascript

Differire l'esecuzione di javascript usando i dati

Dal punto di vista delle performance si dovrebbero caricare i javascript alla fine della pagina (vedere http://developer.yahoo.com/performance/rules.html), almeno tutti i javascript di cui si può differire il caricamento. Ci sono script che devono essere caricati all'inizio della pagina... Ma siamo sicuri che non c'è altra possibilità?

Beh, in realtà questa è una autocritica su di un mio script. Nel codice di imagedata drupal example module rimpiazzo {imagedata ...} con una chiamanta alla funzione del plugin jQuery.

jQuery context menu

Ok, I admit I do not search to much out there if this is available..

A simple jquery plugin that permit to show context menu

I take inspiration from yahoo library: here is an example

But I want it as jquery plugin and also I want to have option to choose the way it should work, for example I also want to fire context menu on hold down left mouse button for 1 second, or just hover on element.

Introduzione a JavaScript - Terza parte

Una video introduzione al linguaggio javascript e le sue principali caratteristiche

In questa terza parte: gli eventi.

Introduzione a JavaScript - Seconda parte

Una video introduzione al linguaggio javascript e le sue principali caratteristiche

In questa seconda parte: oggetti, il DOM, un esempio concreto, le closure

Introduzione a JavaScript - Prima parte

Una breve introduzione al linguaggio e le principali caratteristiche dello scripting client side per il web

Presentati sinteticamente: sintassi, JSON, Object, DOM, Eventi

innerHTML problem with internet explorer (supposed)

I lost some time to debug this

$("#link").click(function(){
   $("#target").load('url/to/load');
});

The problem is on Internet Explorer (all version) that refuse to load data in #target, using $.get and innerHTML(data) do not help. The problem is with no well formed html! Internet Explorer refuse to load in dom a malformed html.
Thus

$("#link").click(function(){
   $("#target").load('url/to/load');
   window.open('url/to/load');
});

jQuery Waiting plugin

This is a simple jQuery plugin for purpose of loading phase of an ajax request or anything else.
$("#testdiv").waiting({imgsrc:"/files/aj-blue.gif"});
to stop a waiting div
$("#testdiv").stopWaiting();
TEST DIV
CLICK ME

move multiple option in select with jQuery

I look for this everywhere: how to move multiple option inside a select
function upfield() {
  var el = $('#selectedfield').children('[@selected]:first').prev();
  $("#selectedfield")
    .children('[@selected]')
    .each(function(){
	$(this).insertBefore(el);
      });

}

function downfield() {
  var el = $('#selectedfield').children('[@selected]:last').next();
  $("#selectedfield")
    .children('[@selected]')
    .each(function(){
	$(this).insertAfter(el);
	el = $(el).next();
      });
}

XMLHttpRequest, document element DOM parsing

XMLHttpRequest use, works only if url is on same site. checklogin.php give <KO/> if login è fails <OK>XXX</OK> with XXX id of user when login è is ok

Syndicate content