Javascript et onglet ?

Salut,

Pour certaines contraintes j'utilise une fonction qui places certains liens en window.open du style :
Code :

1.
<a href="#" onclick="window.open('page.html','_self');">Link</a>



Ca marche tres bien sauf pour les onglets FF, si on fais clic droit onglet ca marche pas
alors je sais que FF prend pas les onclick and co en onglet mais est ce que qqun aurait trouvé une solution ?
 
En fesant comme ca, ca marche :

Code:
<a href="page.html" onclick="window.open(this.href,'_self'); return false;">Link</a>

mais je ne vois pas tellement l'intéret... ca reviens au meme que de faire :

Code:
<a href="page.html" target="_self">Link</a>

:)
 
et pourquoi pas ceci ?
Code:
<a href="#" onClick="document.location.href='page.html';return false;">Link</a>
 
yakipa a dit:
Merci mais je veux pas que certaines url soient crawlables dans le href


Code:
<a href="page.html" onclick="window.open(this.href,'_self'); return false;" rel="nofollow">Link</a>
?
 
NxtGen a dit:
yakipa a dit:
Merci mais je veux pas que certaines url soient crawlables dans le href


Code:
<a href="page.html" onclick="window.open(this.href,'_self'); return false;" rel="nofollow">Link</a>
?

a ce moment autant faire ?


Code:
<a href="page.html" rel="nofollow">Link</a>
 
D'autant plus qu'en mettant l'url dans le href, ton lien sera suivable via clic droit > onglet sous FF.
 
yakipa a dit:
NxtGen a dit:
yakipa a dit:
Merci mais je veux pas que certaines url soient crawlables dans le href


Code:
<a href="page.html" onclick="window.open(this.href,'_self'); return false;" rel="nofollow">Link</a>
?

a ce moment autant faire ?


Code:
<a href="page.html" rel="nofollow">Link</a>

ui c'est ce que je voulais ecrire, mais j'ai oublié d'en enlever la moitié ^^
 
si par ca passe, tu veux dire "pas suivi par les robots", normalement oui.

Aprés tu peux également bloquer la page.html aux robots avec un robot.txt
 
Bonjour,

julienr a dit:
et pourquoi pas ceci ?
Code:
<a href="#" onClick="document.location.href='page.html';return false;">Link</a>

Super réponse !

J'aimerais connaître la même fonction avec l'ouverture d'une nouvelle fenêtre (dimentionnable si possible).

Par exemple Open.New.Window, largeur:600, hauteur:400

Merci de vos réponses !


Handy
 
Voici le bon code :

Code:
<a href="javascript:void(0)" onclick="window.open('http://Monsite.com/Ma-Page.html','welcome','width=800,height=520')">Mon Lien Popup</a>

Lien non comptabilisé par les robots.

Lien non crawlable.

Lien s'ouvrant en popup.

Lien fonctionnant parfaitement sous IE, FF, Opera, Chrome.

Lien s'ouvrant même avec les meilleurs anti popup.

Trop Fort Handy !
 

➡️ Offre MyRankingMetrics ⬅️

pré-audit SEO gratuit avec RM Tech (+ avis d'expert)
coaching offert aux clients (avec Olivier Duffez ou Fabien Faceries)

Voir les détails ici

coaching SEO
Discussions similaires
Haut