<?xml version="1.0" encoding="UTF-8" ?>
<!-- RSS generated by PHPBoost on Sat, 11 Apr 2026 05:33:39 +0200 -->

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Documentation]]></title>
		<atom:link href="https://www.sthda.com/french/syndication/rss/wiki/4" rel="self" type="application/rss+xml"/>
		<link>https://www.sthda.com</link>
		<description><![CDATA[Derniers articles de la catégorie Javascript]]></description>
		<copyright>(C) 2005-2026 PHPBoost</copyright>
		<language>fr</language>
		<generator>PHPBoost</generator>
		
		
		<item>
			<title><![CDATA[Zoomer une image avec javascript]]></title>
			<link>https://www.sthda.com/french/wiki/zoomer-une-image-avec-javascript</link>
			<guid>https://www.sthda.com/french/wiki/zoomer-une-image-avec-javascript</guid>
			<description><![CDATA[<h3 class="formatter-title">MojoZoom - Free JavaScript Image Zoom </h3><br />
<br />
<a href="http://www.nihilogic.dk/labs/mojozoom/">http://www.nihilogic.dk/labs/mojozoom/</a><br />
<br />
  <span class="formatter-code">Code HTML :</span><div class="code"><pre style="display:inline;"><pre class="html" style="font-family:monospace;">  <span style="color: #808080; font-style: italic;"><!-- Step 1: include the JavaScript and CSS files  --></span>  
  <span style="color: #009900;"><<a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"text/javascript"</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"mojozoom.js"</span>><<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">script</span></a>></span>  
   <span style="color: #009900;"><<a href="http://december.com/html/4/element/link.html"><span style="color: #000000; font-weight: bold;">link</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"text/css"</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"mojozoom.css"</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"stylesheet"</span> <span style="color: #66cc66;">/</span>></span>  
&nbsp;
   <span style="color: #808080; font-style: italic;"><!-- Step 2: add the custom 'data-zoomsrc' attribute to your image to specify the source of the large image --></span>  
  <span style="color: #009900;"><<a href="http://december.com/html/4/element/img.html"><span style="color: #000000; font-weight: bold;">img</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"kendwa_small.jpg"</span> data-zoomsrc<span style="color: #66cc66;">=</span><span style="color: #ff0000;">"kendwa_big.jpg"</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">"myimage"</span> <span style="color: #66cc66;">/</span>></span>  </pre></pre></div>]]></description>
			<pubDate>Sun, 03 Apr 2011 02:52:32 +0200</pubDate>
			
		</item>
		
		<item>
			<title><![CDATA[Introduction à javascript]]></title>
			<link>https://www.sthda.com/french/wiki/introduction-a-javascript</link>
			<guid>https://www.sthda.com/french/wiki/introduction-a-javascript</guid>
			<description><![CDATA[<br />
<h3 class="formatter-title">D?but du script</h3><br />
<span class="formatter-code">Code JAVASCRIPT :</span><div class="code"><pre style="display:inline;"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;"><</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">"text/javascript"</span><span style="color: #339933;">></span>
&nbsp;
   <span style="color: #006600; font-style: italic;">/* votre code javascript se trouve ici
   c'est deja plus pratique pour un script de plusieurs lignes */</span>
&nbsp;
<span style="color: #339933;"></</span>script<span style="color: #339933;">></span></pre></pre></div><br />
<br />
<h3 class="formatter-title">Importer un fichier externe</h3><br />
<span class="formatter-code">Code JAVASCRIPT :</span><div class="code"><pre style="display:inline;"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;"><</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">"text/javascript"</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">"script.js"</span><span style="color: #339933;">></</span>script<span style="color: #339933;">></span></pre></pre></div><br />
<br />
<h3 class="formatter-title">Quelques fonctions</h3><br />
<span class="formatter-code">Code JAVASCRIPT :</span><div class="code"><pre style="display:inline;"><pre class="javascript" style="font-family:monospace;">&nbsp;
&nbsp;
<span style="color: #006600; font-style: italic;">/*--------------------------------------------
Demander, cr?er  et afficher une variable
---------------------------------------------*/</span>
<span style="color: #000066; font-weight: bold;">var</span> age<span style="color: #339933;">=</span><span style="color: #CC0000;">18</span><span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">//Cr?ation d'une variable age</span>
alert<span style="color: #009900;">&#40;</span>age<span style="color: #009900;">&#41;</span><span style="color: #006600; font-style: italic;">//affichage de la variable age</span>
alert<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">"Vous avez "</span> <span style="color: #339933;">+</span> age <span style="color: #339933;">+</span> <span style="color: #3366CC;">" ans"</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// Concat?nation :on affiche les chaines mises bout-?-bout</span>
<span style="color: #000066; font-weight: bold;">var</span> age <span style="color: #339933;">=</span> prompt<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">"Quel ?ge avez-vous ? (en ann?es)"</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// on demande l'age</span>
&nbsp;
&nbsp;
<span style="color: #006600; font-style: italic;">/*--------------------------------------------
Cr?er une fonction
---------------------------------------------*/</span>
<span style="color: #000066; font-weight: bold;">function</span> conversion<span style="color: #009900;">&#40;</span>taux<span style="color: #009900;">&#41;</span>   <span style="color: #006600; font-style: italic;">// declaration de la fonction avec un argument</span>
<span style="color: #009900;">&#123;</span>
   <span style="color: #000066; font-weight: bold;">var</span> valeur <span style="color: #339933;">=</span> prompt<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">"Entrez la valeur ? convertir"</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000066; font-weight: bold;">var</span> resultat <span style="color: #339933;">=</span> valeur <span style="color: #339933;">*</span> taux<span style="color: #339933;">;</span>   <span style="color: #006600; font-style: italic;">// on calcule le resultat, en utilisant l'argument</span>
   alert<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Valeur  : '</span><span style="color: #339933;">+</span>valeur <span style="color: #339933;">+</span> <span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>R?sultat : '</span><span style="color: #339933;">+</span>resultat<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000066; font-weight: bold;">return</span> resultat<span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//on retourne la valeur</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">/*--------------------------------------------
Tableaux
---------------------------------------------*/</span>
<span style="color: #000066; font-weight: bold;">var</span> table <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">new</span> <span style="">Array</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">"Pierre"</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">"Paul"</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">"Jacques"</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">// tableau index?</span>
alert<span style="color: #009900;">&#40;</span>table<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">var</span> scores <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">new</span> <span style="">Array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">//tableau associatif</span>
scores<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">"Toto"</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">142</span><span style="color: #339933;">;</span>
scores<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">"Pierre"</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">137</span><span style="color: #339933;">;</span>
alert<span style="color: #009900;">&#40;</span>table<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">"Toto"</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
table.<span style="color: #660066;">length</span><span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">//longueur du tableau</span>
<span style="color: #006600; font-style: italic;">// une fonction qui retourne, sous forme de cha?ne de caract?res, le contenu du tableau </span>
<span style="color: #000066; font-weight: bold;">function</span> lire1<span style="color: #009900;">&#40;</span>tab<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">var</span> chaine <span style="color: #339933;">=</span> <span style="color: #3366CC;">"Le tableau contient :"</span>
        <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;"><</span>tab.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
                chaine <span style="color: #339933;">+=</span> <span style="color: #3366CC;">"<span style="color: #000099; font-weight: bold;">\n</span>"</span> <span style="color: #339933;">+</span> i <span style="color: #339933;">+</span> <span style="color: #3366CC;">" -> "</span> <span style="color: #339933;">+</span> tab<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">return</span> chaine<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">/*--------------------------------------------
Les objets html
---------------------------------------------*/</span>
<span style="color: #006600; font-style: italic;">//Atteindre les objets</span>
document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">"id"</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
getElementsByTagName<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">"textarea"</span><span style="color: #009900;">&#41;</span><span style="color: #006600; font-style: italic;">//ex:retourne un tableau contenant tous les ?l?ments <textarea> de la page</span>
document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'textarea'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">//Si on veut acc?der au second <textarea> de la page </span>
&nbsp;
&nbsp;</pre></pre></div><br />
<br />
<h3 class="formatter-title">Les ?v?nements</h3><br />
    * onClick et onDblClick : lors d'un clic / double clic sur l'?l?ment en question<br />
    * onKeyPress : lorsqu'on appuie sur une touche avec cet ?l?ment s?lectionn?<br />
    * onKeyDown et onKeyUp : lorsqu'une touche est enfonc?e / rel?ch?e avec cet ?l?ment s?lectionn?<br />
    * onmouseover et onmouseout : lorsque le pointeur de la souris arrive sur l'?l?ment / sort de cet ?l?ment<br />
    * onmousemove : lors d'un d?placement de la souris au-dessus de cet ?l?ment<br />
    * onMouseDown et onMouseUp : lorsque le bouton de la souris est enfonc? / rel?ch? sur cet ?l?ment<br />
<br />
<br />
<span class="formatter-code">Code JAVASCRIPT :</span><div class="code"><pre style="display:inline;"><pre class="javascript" style="font-family:monospace;">&nbsp;
<span style="color: #006600; font-style: italic;">/*--------------------------------------------
Acc?der aux ?l?ments d'un formulaire
---------------------------------------------*/</span>
<span style="color: #000066; font-weight: bold;">var</span> monForm <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">"monFormulaire"</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">var</span> champPseudo <span style="color: #339933;">=</span> monForm.<span style="color: #660066;">pseudo</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">/*--------------------------------------------
le mot-cl? "this"
---------------------------------------------*/</span>
&nbsp;
<span style="color: #339933;"><</span>img src<span style="color: #339933;">=</span><span style="color: #3366CC;">"photo.jpg"</span> alt<span style="color: #339933;">=</span><span style="color: #3366CC;">""</span> onclick<span style="color: #339933;">=</span><span style="color: #3366CC;">"this.src='image.jpg'"</span> <span style="color: #339933;">/></span>
&nbsp;
&nbsp;
&nbsp;</pre></pre></div>]]></description>
			<pubDate>Wed, 10 Nov 2010 17:12:14 +0100</pubDate>
			
		</item>
		
		<item>
			<title><![CDATA[Javascript]]></title>
			<link>https://www.sthda.com/french/wiki/javascript</link>
			<guid>https://www.sthda.com/french/wiki/javascript</guid>
			<description><![CDATA[Javascript<br />]]></description>
			<pubDate>Wed, 10 Nov 2010 17:11:17 +0100</pubDate>
			
		</item>
		
	</channel>
</rss>
