11485 sujets

JavaScript, DOM et API Web HTML5

Bonjour, comme précisé le bouton +1 de Google ne fonctionne pas sur mon site : -www.site-image.eu (voir sur footer)
j'ai collé le script, rien de compliqué, ensuite je clique, je me log et j'ai le point d'exclamation rouge qui apparaît Smiley ohwell
Est-ce que vous avez rencontré ce problème ? Merci de vos réponses - N.
Modifié par Laurie-Anne (12 Oct 2011 - 18:18)
J'avais suivi cette procédure mais ça ne marche, je pense que le problème se situe ailleurs… Smiley confus
Je suis allé sur ta page, tu ne places pas ton script dans le <head>,
le problème se situe là. Smiley cligne
J'ai essayé ça ne fonctionne pas mieux… (avant </body> et dans <head>) Smiley decu

Sinon j'ai trouvé ça (ce qui me laisse à penser que le problème est peut-être lié à des identifiants de connexion ou de compte présents sur l'index (?) Smiley ohwell

Il est en effet recommandé d'utiliser les attributs href ou rel=canonical car cela permet d'éviter des problèmes potentiels. Par exemple dans le cas ou l'on "+1" une URL qui contient des identifiants de session ou d'autres paramètres.
Voici l'article qui traite de la question (en anglais uniquement) :

----------------------------------------------------------------------------
+1 target URL

The URL that is +1'd is determined by one of three things, in this order:


1) The href attribute

As defined in +1 tag parameters, this is an attribute of the +1 tag that explicitly specifies the URL to be +1'd.


2) The value of the link rel="canonical" tag

If the href attribute of the +1 tag has not been set, the next place Google will look is a link tag with rel="canonical" set. More information can be found in this help article.


3) The URL of the page as defined in document.location.href

If neither the href nor the link rel="canonical" are specified, Google will use the URL of the page as found in the DOM. This can sometimes cause incorrect behavior as the URL in the address bar can contain session IDs or other parameters which are not part of the canonical URL. Therefore, we highly recommend using either the href attribute orrel="canonical".

Note: The +1 is a public action and must be performed on a public URL. If you attempt to +1 a URL that is not public, an error will occur.