<?xml version="1.0" encoding="UTF-8" ?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Posteet: javascript</title> 
    <link>http://www.posteet.com/</link> 
    <description>Recent posteets posted to Posteet</description>
    <ttl>60</ttl>

    
    <item>
        <title>focus sur le premier input avec jquery</title>
        <link>http://www.posteet.com/view/1335</link>
        <description>
        <![CDATA[<pre>$(&quot;input:visible:enabled:first&quot;).focus();</pre> <a href="http://www.posteet.com/tags/javascript">[javascript]</a>  <a href="http://www.posteet.com/tags/jquery">[jquery]</a> ]]>        </description>
        <dc:creator>minus</dc:creator>
        <pubDate>Fri, 24 Oct 2008 09:01:13 +0000</pubDate>

            <category>javascript</category>
            <category>jquery</category>
    
    </item>

  
    <item>
        <title>MooTools Controllers class</title>
        <link>http://www.posteet.com/view/1306</link>
        <description>
        <![CDATA[<pre>/*

Class: Controllers

This is a namespace for all the classes that control interactive behavior on the
page. It also manages event messaging so that controllers can communicate with
each other.

*/
var Controllers = new Class({

  Implements: Events,
  
  initialize: function(cssPrefix) {
    this.controllers = [];
    window.addEvent('domready', this.initializeControllers.bind(this, cssPrefix));
  },
  
  initializeControllers: function(cssPrefix) {
    
    // After the page loads, search for elements with particular CSS classes
    // that correspond to JavaScript behavior controllers.
    
    for (property in this) {
      if ($type(this[property]) != 'class') {
        continue;
      }
      dbug.log(property);
      $$('.' + cssPrefix + property).each(function(el) {
        try {
          var Controller = this[property];
          this.controllers.push(new Controller(el, this));
        } catch(e) {
          dbug.log(e.message);
        }
      }.bind(this));
    }
    this.fireEvent('onInitialize');
    
  }
  
});

dbug.enable();
var Page = new Controllers('JS_');

// In another file, calendar.js
Page.Calendar = new Class({
  initialize: function(el, page) {
    // ...
  }
});</pre> <a href="http://www.posteet.com/tags/behavior">[behavior]</a>  <a href="http://www.posteet.com/tags/controller">[controller]</a>  <a href="http://www.posteet.com/tags/javascript">[javascript]</a>  <a href="http://www.posteet.com/tags/mootools">[mootools]</a> ]]>        </description>
        <dc:creator>dphiffer</dc:creator>
        <pubDate>Tue, 07 Oct 2008 14:18:24 +0000</pubDate>

            <category>behavior</category>
            <category>controller</category>
            <category>javascript</category>
            <category>mootools</category>
    
    </item>

  
    <item>
        <title>Mostrar todos los elementos de un formulario</title>
        <link>http://www.posteet.com/view/1297</link>
        <description>
        <![CDATA[<pre>&lt;html&gt;
&lt;body&gt;

&lt;form id=&quot;myForm&quot;&gt;
Firstname: &lt;input id=&quot;fname&quot; type=&quot;text&quot; value=&quot;Mickey&quot; /&gt;
Lastname: &lt;input id=&quot;lname&quot; type=&quot;text&quot; value=&quot;Mouse&quot; /&gt;
&lt;input id=&quot;sub&quot; type=&quot;button&quot; value=&quot;Submit&quot; /&gt;
&lt;/form&gt;

&lt;p&gt;Get the value of all the elements in the form:&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
var x=document.getElementById(&quot;myForm&quot;);
for (var i=0;i&lt;x.length;i++)
  {
  document.write(x.elements[i].value);
  document.write(&quot;&lt;br /&gt;&quot;);
  }
&lt;/script&gt;
&lt;/p&gt;

&lt;/body&gt;
&lt;/html&gt;</pre> <a href="http://www.posteet.com/tags/DOM">[DOM]</a>  <a href="http://www.posteet.com/tags/formularios">[formularios]</a>  <a href="http://www.posteet.com/tags/javascript">[javascript]</a>  <a href="http://www.posteet.com/tags/validacion">[validacion]</a> ]]>        </description>
        <dc:creator>jacinmontava</dc:creator>
        <pubDate>Thu, 02 Oct 2008 07:42:19 +0000</pubDate>

            <category>DOM</category>
            <category>formularios</category>
            <category>javascript</category>
            <category>validacion</category>
    
    </item>

  
    <item>
        <title>Gérer les cookies avec du Javascript</title>
        <link>http://www.posteet.com/view/1295</link>
        <description>
        <![CDATA[<pre>//Insérer les fonctions javascript (dans l'en-tête de vos pages, directement ou dans un fichier .js).
//---------------------------------------------------------------------------------------------------

function ecrire_cookie(nom, valeur, expires) {
  document.cookie=nom+&quot;=&quot;+escape(valeur)+
  ((expires==null) ? &quot;&quot; : (&quot;; expires=&quot;+expires.toGMTString()));
}

function arguments_cookie(offset){
  var endstr=document.cookie.indexOf (&quot;;&quot;, offset);
  if (endstr==-1) endstr=document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr)); 
}

function lire_cookie(nom) {
  var arg=nom+&quot;=&quot;;
  var alen=arg.length;
  var clen=document.cookie.length;
  var i=0;
  while (i&lt;clen){
    var j=i+alen;
    if (document.cookie.substring(i, j)==arg)
       return arguments_cookie(j);
    i=document.cookie.indexOf(&quot; &quot;,i)+1;
    if (i==0) break;
  }
  return null; 
}


//Faire appel aux fonctions : écrire un cookie avec javascript.
//-------------------------------------------------------------

// Création d'un cookie non persistant (pas de date)
// ce cookie s'effacera à la fin de la session
  ecrire_cookie(&quot;deja_venu&quot;, &quot;oui&quot;);

// Création d'un cookie persistant (la date est fixée)
// le cookie s'effacera dans x jours, x mois etc.
// ici le cookie restera 1 mois.
  date=new Date;
  date.setMonth(date.getMonth()+1); // expire dans un mois
  ecrire_cookie(&quot;deja_venu&quot;, &quot;oui&quot;, date);


//Faire appel aux fonctions : lire un cookie avec javascript.
//-----------------------------------------------------------

  deja_venu = lire_cookie(&quot;deja_venu&quot;);</pre> <a href="http://www.posteet.com/tags/cookies">[cookies]</a>  <a href="http://www.posteet.com/tags/javascript">[javascript]</a> ]]>        </description>
        <dc:creator>cyo</dc:creator>
        <pubDate>Tue, 30 Sep 2008 09:53:20 +0000</pubDate>

            <category>cookies</category>
            <category>javascript</category>
    
    </item>

  
    <item>
        <title>Embed books from Google book</title>
        <link>http://www.posteet.com/view/1283</link>
        <description>
        <![CDATA[<pre>&lt;script type=&quot;text/javascript&quot; src=&quot;http://books.google.com/books/previewlib.js&quot;&gt;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;GBS_insertEmbeddedViewer('xxxxxxxxxxxx',500,500);
&lt;/script&gt;</pre> <a href="http://www.posteet.com/tags/book">[book]</a>  <a href="http://www.posteet.com/tags/embed">[embed]</a>  <a href="http://www.posteet.com/tags/google">[google]</a>  <a href="http://www.posteet.com/tags/javascript">[javascript]</a> ]]>        </description>
        <dc:creator>stephane</dc:creator>
        <pubDate>Wed, 24 Sep 2008 16:04:48 +0000</pubDate>

            <category>book</category>
            <category>embed</category>
            <category>google</category>
            <category>javascript</category>
    
    </item>

  
    <item>
        <title>Récupérer une ancre dans l'URL en javascript</title>
        <link>http://www.posteet.com/view/1235</link>
        <description>
        <![CDATA[<pre>anchor = window.location.hash;
anchor = anchor.substring(1,anchor.length); // enleve le #

//-- Juste pour l'archivage, voici le code que j'utilisais avant de savoir qu'une fonction js existait
var url = document.location.toString();
if (myFile.match('#')) {
    var anchor = myFile.split('#')[1];
}</pre> <a href="http://www.posteet.com/tags/anchor">[anchor]</a>  <a href="http://www.posteet.com/tags/javascript">[javascript]</a> ]]>        </description>
        <dc:creator>spirit</dc:creator>
        <pubDate>Mon, 01 Sep 2008 09:10:03 +0000</pubDate>

            <category>anchor</category>
            <category>javascript</category>
    
    </item>

  
    <item>
        <title>Executer du javascript chargé par une requête AJAX</title>
        <link>http://www.posteet.com/view/1207</link>
        <description>
        <![CDATA[<pre>// Le JS dans la div ci-dessous a été inséré par une requete AJAX
// &lt;div id='mydiv'&gt; &lt;script type='text/javascript'&gt; [...] &lt;/script&gt; &lt;/div&gt;

var div = document.getElementById('mydiv');
div.innerHTML = innerHTML;
var x = div.getElementsByTagName(&quot;script&quot;); 
for(var i=0;i&lt;x.length;i++)
{
       eval(x[i].text);
}</pre> <a href="http://www.posteet.com/tags/ajax">[ajax]</a>  <a href="http://www.posteet.com/tags/eval">[eval]</a>  <a href="http://www.posteet.com/tags/javascript">[javascript]</a> ]]>        </description>
        <dc:creator>spirit</dc:creator>
        <pubDate>Thu, 21 Aug 2008 19:50:30 +0000</pubDate>

            <category>ajax</category>
            <category>eval</category>
            <category>javascript</category>
    
    </item>

  
    <item>
        <title>Support de la sortie de commande diff pour codepress (partie Javascript)</title>
        <link>http://www.posteet.com/view/1095</link>
        <description>
        <![CDATA[<pre>/* 
* CodePress regular expressions for DIFF syntax highlighting 
*/ 
 
// DIFF 
Language.syntax = [ 
{ input : /([0-9,]*)(c|d|a)([0-9,]+)(&lt;br|&lt;\/P)/g,output : '&lt;lines&gt;$1$2$3&lt;/lines&gt;$4' }, 
{ input : /(&gt;)(\-{3})(&lt;br|&lt;\/P)/g,output : '$1&lt;separator&gt;$2&lt;/separator&gt;$3'}, 
{ input : /(&gt;)(&amp;lt;.+?)(&lt;br|&lt;\/P)/g,output : '$1&lt;before&gt;$2&lt;/before&gt;$3'}, 
{ input : /(&gt;)(&amp;gt;.+?)(&lt;br|&lt;\/P)/g,output : '$1&lt;after&gt;$2&lt;/after&gt;$3' }, 
{ input : /(Common subdirectories.+?)(&lt;br|&lt;\/P)/g,output : '&lt;common&gt;$1&lt;/common&gt;$2' }, 
{ input : /(Only in )(.+?)(: )(.+?)(&lt;br|&lt;\/P)/g,output : '&lt;onlyin&gt;$1$2$3$4&lt;/onlyin&gt;$5' }, 
{ input : /(diff )(.+?)( )(.+?)(&lt;br|&lt;\/P)/g,output : '&lt;diff&gt;$1$2$3$4&lt;/diff&gt;$5' } 
] 
 
Language.snippets = [] 
 
Language.complete = [] 
 
Language.shortcuts = []</pre> <a href="http://www.posteet.com/tags/codepress">[codepress]</a>  <a href="http://www.posteet.com/tags/diff">[diff]</a>  <a href="http://www.posteet.com/tags/expressions regulieres">[expressions regulieres]</a>  <a href="http://www.posteet.com/tags/javascript">[javascript]</a> ]]>        </description>
        <dc:creator>benoitbalon</dc:creator>
        <pubDate>Wed, 09 Jul 2008 17:30:37 +0000</pubDate>

            <category>codepress</category>
            <category>diff</category>
            <category>expressions regulieres</category>
            <category>javascript</category>
    
    </item>

  
    <item>
        <title>Selenium : Vérifie qu'un champ n'est pas vide</title>
        <link>http://www.posteet.com/view/995</link>
        <description>
        <![CDATA[<pre>Ici on vérifie que le champ 'NomEmp' contient des lettres non accentuées :

&lt;tr&gt;
    &lt;td&gt;assertText&lt;/td&gt;
    &lt;td&gt;NomEmp&lt;/td&gt;
    &lt;td&gt;regex:^[a-zA-Z]*$&lt;/td&gt;
&lt;/tr&gt;</pre> <a href="http://www.posteet.com/tags/javascript">[javascript]</a>  <a href="http://www.posteet.com/tags/selenium">[selenium]</a>  <a href="http://www.posteet.com/tags/texte">[texte]</a> ]]>        </description>
        <dc:creator>cyo</dc:creator>
        <pubDate>Mon, 02 Jun 2008 11:25:57 +0000</pubDate>

            <category>javascript</category>
            <category>selenium</category>
            <category>texte</category>
    
    </item>

  
    <item>
        <title>Selenium : Vérifier la présence d'une image sur une page</title>
        <link>http://www.posteet.com/view/994</link>
        <description>
        <![CDATA[<pre>&lt;tr&gt;
	&lt;td&gt;assertElementPresent&lt;/td&gt;
	&lt;td&gt;//img[contains(@src,&quot;medias/carte/top.jpg&quot;)]/@src&lt;/td&gt;
	&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;</pre> <a href="http://www.posteet.com/tags/image">[image]</a>  <a href="http://www.posteet.com/tags/javascript">[javascript]</a>  <a href="http://www.posteet.com/tags/selenium">[selenium]</a> ]]>        </description>
        <dc:creator>cyo</dc:creator>
        <pubDate>Mon, 02 Jun 2008 07:39:25 +0000</pubDate>

            <category>image</category>
            <category>javascript</category>
            <category>selenium</category>
    
    </item>

  
    <item>
        <title>Menu déroulant qui se déroule/cache quand la souris est dessus avec JQuery</title>
        <link>http://www.posteet.com/view/952</link>
        <description>
        <![CDATA[<pre>&lt;script src=&quot;http://iscripting.net/jquery/jquery_1.2.1.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
$(document).ready(function(){

$(&quot;#drop_down&quot;).hide();
$(&quot;#drop_down&quot;).animate({

opacity:0.5

});


$(&quot;a:contains('blah')&quot;).mouseover(function() {

$(&quot;#drop_down&quot;).show(&quot;slow&quot;);

});

$(&quot;#drop_down&quot;).mouseout(function(){

$(this).hide('slow');

});



});
&lt;/script&gt;
&lt;style&gt;
#drop_down {
background:olive;
width:100px;
height:200px;
z-index:1;
}

#hori_menu {
height:60px;
border: 2px solid #EEEEEE;
width:400px;
}
&lt;/style&gt;

&lt;div id=&quot;hori_menu&quot;&gt;
&lt;a href=&quot;#&quot;&gt;Google&lt;/a&gt;
&lt;br /&gt;
&lt;div id=&quot;drop_down&quot;&gt;
Bleh&lt;br /&gt;
Blub&lt;br /&gt;
Burp&lt;br /&gt;

Items
&lt;/div&gt;
&lt;/div&gt;</pre> <a href="http://www.posteet.com/tags/Déroulant">[Déroulant]</a>  <a href="http://www.posteet.com/tags/Javascript">[Javascript]</a>  <a href="http://www.posteet.com/tags/Menu">[Menu]</a> ]]>        </description>
        <dc:creator>angenoir</dc:creator>
        <pubDate>Fri, 09 May 2008 16:31:58 +0000</pubDate>

            <category>Déroulant</category>
            <category>Javascript</category>
            <category>Menu</category>
    
    </item>

  
    <item>
        <title>Selenium : Simuler un évènement Javascript depuis Selenium</title>
        <link>http://www.posteet.com/view/785</link>
        <description>
        <![CDATA[<pre>Par exemple, un évènement &quot;onblur()&quot; sur champ &lt;input&gt; :

&lt;tr&gt;
  &lt;td&gt;type&lt;/td&gt;
  &lt;td&gt;nom&lt;/td&gt;
  &lt;td&gt;nom&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;fireEvent&lt;/td&gt;
  &lt;td&gt;nom&lt;/td&gt;
  &lt;td&gt;blur&lt;/td&gt;
&lt;/tr&gt;


Pour un évènement &quot;onkeyup()&quot; :

&lt;tr&gt;
  &lt;td&gt;type&lt;/td&gt;
  &lt;td&gt;code_postal&lt;/td&gt;
  &lt;td&gt;75000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td&gt;keyUp&lt;/td&gt;
  &lt;td&gt;code_postal&lt;/td&gt;
  &lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;</pre> <a href="http://www.posteet.com/tags/ajax">[ajax]</a>  <a href="http://www.posteet.com/tags/évènement">[évènement]</a>  <a href="http://www.posteet.com/tags/javascript">[javascript]</a>  <a href="http://www.posteet.com/tags/selenium">[selenium]</a> ]]>        </description>
        <dc:creator>cyo</dc:creator>
        <pubDate>Fri, 22 Feb 2008 15:19:55 +0000</pubDate>

            <category>ajax</category>
            <category>évènement</category>
            <category>javascript</category>
            <category>selenium</category>
    
    </item>

  
    <item>
        <title>Selenium : Interagir avec le code Javascript d'une page, depuis un script Selenium</title>
        <link>http://www.posteet.com/view/782</link>
        <description>
        <![CDATA[<pre>Exemple pour afficher la valeur d’une variable qui se nomme &quot;maVariable&quot; :
&lt;tr&gt;
	&lt;td&gt;eval&lt;/td&gt;
	&lt;td&gt;javascript{alert(this.browserbot.getCurrentWindow().maVariable)}&lt;/td&gt;
	&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;</pre> <a href="http://www.posteet.com/tags/affichage">[affichage]</a>  <a href="http://www.posteet.com/tags/javascript">[javascript]</a>  <a href="http://www.posteet.com/tags/selenium">[selenium]</a>  <a href="http://www.posteet.com/tags/variable">[variable]</a> ]]>        </description>
        <dc:creator>cyo</dc:creator>
        <pubDate>Thu, 21 Feb 2008 10:35:15 +0000</pubDate>

            <category>affichage</category>
            <category>javascript</category>
            <category>selenium</category>
            <category>variable</category>
    
    </item>

  
    <item>
        <title>Enviar formulario al pulsar 'Intro'</title>
        <link>http://www.posteet.com/view/768</link>
        <description>
        <![CDATA[<pre>&lt;html&gt;
&lt;head&gt;
   &lt;title&gt;Enviar formulario al pulsar un enlace&lt;/title&gt;
&lt;script&gt;
function enviar_formulario(){
   document.formulario1.submit()
}
&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;form action=&quot;pagina_destino.php&quot; method=post name=&quot;formulario1&quot;&gt;
   &lt;input name=&quot;nombre&quot; onkeypress=&quot;if (event.keyCode == 13) enviar_formulario()&quot;/&gt;
&lt;/form&gt;

&lt;/body&gt;
&lt;/html&gt;</pre> <a href="http://www.posteet.com/tags/formularios">[formularios]</a>  <a href="http://www.posteet.com/tags/javascript">[javascript]</a> ]]>        </description>
        <dc:creator>jacinmontava</dc:creator>
        <pubDate>Mon, 18 Feb 2008 10:37:55 +0000</pubDate>

            <category>formularios</category>
            <category>javascript</category>
    
    </item>

  
    <item>
        <title>Enviar Form desde enlace</title>
        <link>http://www.posteet.com/view/767</link>
        <description>
        <![CDATA[<pre>&lt;html&gt;
&lt;head&gt;
   &lt;title&gt;Enviar formulario al pulsar un enlace&lt;/title&gt;
&lt;script&gt;
function enviar_formulario(){
   document.formulario1.submit()
}
&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;form action=&quot;pagina_destino.php&quot; method=post name=&quot;formulario1&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;campo1&quot; value=&quot;valor&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;campo2&quot; value=&quot;otroValor&quot;&gt;
&lt;/form&gt;

&lt;a href=&quot;javascript:enviar_formulario()&quot;&gt;Enviar formulario&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;</pre> <a href="http://www.posteet.com/tags/formularios">[formularios]</a>  <a href="http://www.posteet.com/tags/javascript">[javascript]</a> ]]>        </description>
        <dc:creator>jacinmontava</dc:creator>
        <pubDate>Mon, 18 Feb 2008 10:33:56 +0000</pubDate>

            <category>formularios</category>
            <category>javascript</category>
    
    </item>


</channel>
</rss>
