javascript

Signal page as correct in Google Webmaster Tool (simulate mouse click)

Google webmaster tool signals scanning errors. The is option to signal error a scorrected, but sometime a lot of error is solved at once, but interface do not give option to select it all.

Also this trick could be usefull in other service..

I loaded this code in chrome console (developer tool), modified from example code https://developer.mozilla.org/en/DOM/element.dispatchEvent

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

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();

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();
      });
}