des centaines d'astuces pour vous faciliter le quotidien


LES CODES "META"

LES CODES "META"

 

 

 

 

              

 

 

 Vous entendrez parfois aussi les expressions "META lines", "META tags", "Lignes META".
 

 Les codes META sont assez important, ils seront exploités par les furteurs (robots - spiders)

 

 des moteurs de recherche lors de votre référencement.

 

 Vous devrez insérer ces codes META entre les balises

 

 et Certain de ces codes META n'ont pratiquement plus d'audience auprès des moteurs,

 

 

 tel que "keywords" où Google préfère constituer sa propre liste de mots clés en rapports avec votre pages.

 
Je vous suggère la page suivante où vous pourrez générer vos éléménts "META" en replissant le forulaire  :
 
 
 
 
 
SOMMAIRE
 
 
 
 : Titre de la page

 

 
 

 : Titre de la page

 

 

 : Description de la page

 

 

 

 : Description de la page

 

 Sa présence n'est exploitée que par quelques moteurs.
 

Les régles et recommandations sont les mêmes .

 

 

 
 

 : Liste de mots clés

 

 
 

 : Défini le type d'encodage de caractères utilisé sur la page

 

 
 

 : Renseigne le nom de l'auteur, créateur ou webmasteur du site

 

 
 

 : Renseigne le nom du propriétaire (ou client) du site

 

 
 

 : Instructions pour les robots des moteurs

 

 
 

 : Instructions pour les robots des moteurs

 

 
 

 : Iinstruction obligeant le navigateur de vos visiteurs à recharger complètement la page lors de chaque visite.

 

 
 

 

 : Appelé favicon, cette petite icone apparaîtra dans la barre d'adresse des navigateurs,

  

  donnant ainsi une petite touche estétique.

 

 

 
 
 
 
EXEMPLE DE CODE QUE VOUS POUVEZ COPIÉ
 
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="https://www.adobe.com/2006/mxml"
    horizontalScrollPolicy="off" verticalScrollPolicy="off">
    <mx:Canvas id="frm" 
        width="{this.width}" height="{this.height}"
        backgroundColor="0xFFFFFF" backgroundAlpha="0.4"
        cornerRadius="10" borderStyle="solid">
        <mx:Image id="img" 
            horizontalCenter="0" horizontalAlign="center"
            verticalCenter="0" verticalAlign="middle"
            source="{_imgSrc}"
            complete="handleImageComplete(event)"
            maxWidth="{this.width-20}" 
            maxHeight="{this.height-20}"/>
    mx:Canvas>
 
    -- we specify "myevent" attribute to be triggered the 
         string in name attribute must match the string 
         specified in "new MyEvent()" and to be more precise
         MyEvent.MY_EVENT should be equal with "myevent" -->
    <mx:Metadata>
        [Event(name="myevent", type="com.MyEvent")]
    mx:Metadata>
 
    <mx:Script>
        [CDATA[
 
        // our loaded image
        [Bindable]
        private var _imgSrc:String;
 
        // setter to be able to set the image 
        // from outside the component
        public function set source(s:String):void
        {
            _imgSrc = s;
        }
 
        // getter
        public function get source():String
        {
            return _imgSrc;
        }
 
        // event handler triggered by the image object
        // when the image is fully loaded
        public function handleImageComplete(event:Event):void
        {
            // we dispatch our new custom event
            // it is important:
            // 1) that MyEvent.MY_EVENT should
            //    match the string "myevent" specified in
            //    the name attribute of the event meta tag             
            // 2) that the type of the event object dispatched
            //    further must match the one defined in event
            //    meta tag
            dispatchEvent(new MyEvent(MyEvent.MY_EVENT));
        }
 
        ]]>
    mx:Script>
mx:Canvas>

 

package com
{
    import flash.events.Event;
 
    // our custom event extends flash.events.Event
    public class MyEvent extends Event
    {
        // the string must be the same with the one specified
        // in the Event metatag in name attribute
        public static const MY_EVENT:String = "myevent";
 
        // constructor
        public function MyEvent(type:String):void
        {
            super(type);
        }
    }
}

FramedImageApp.mxml – main application

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="https://www.adobe.com/2006/mxml" 
    layout="absolute" xmlns:com="com.*" width="270" height="450">
    <com:FramedImage id="frmImg" x="10" y="10" 
        width="250" height="250"
        myevent="handleMyEvent(event)"
        source="{imgUrl.text}"/>
    <mx:Label text="Image to load (URL):" x="10" y="268"/>
    <mx:TextInput id="imgUrl" width="250" x="10" y="284"
        text="https://www.flexer.info/wp-content/uploads/2008/05/imgs/fxr-4_1280x1024.png"/>
    <mx:Label text="Events:" x="10" y="314"/>
    <mx:TextArea id="dbgTxt" width="250" height="110" x="10" y="331"/>
    <mx:Script>
        [CDATA[
            import com.MyEvent;
 
            private function handleMyEvent(event:MyEvent):void
            {
                // split the URL
                var tmpArr:Array = new Array();
                tmpArr = imgUrl.text.split("/");
                // add text with filename
                dbgTxt.text += "image " + tmpArr[tmpArr.length-1] + " loaded\n";
            }
        ]]>
    mx:Script>
mx:Application>