Share Facebook or Line with onclick function but get SEO problem Links are not crawlable

0 votes
Feb 19 in Others by Kichu
• 19,040 points
498 views

1 answer to this question.

0 votes

ignore the error message its nothing to fear about  try this code  as a reference and change your code accordingly 

var anchors = document.querySelectorAll('.sharer');

for(var z = 0; z < anchors.length; z++) {

anchors[z].addEventListener('click', function(e) {
//stop the default click action
  e.preventDefault();
// grab the base sharing URL
  var URL = e.target.getAttribute('data-url');
// grab the name we want to give the window (parameter 2 on window.open)
  var windowName = e.target.getAttribute('data-windowName');
// Grab parameter 3 for window.oprn (window settings)
  var windowSettings = e.target.getAttribute('data-settings');
// call window.open
  window.open(URL + window.location.href, windowName, windowSettings);
}, false);

}
<h2>Won't work on Stack Overflow due to sandbox so may need tweaking your side</h2>

<a class="sharer" href="http://www.facebook.com/share.php?u=https://stackoverflow.com/questions/64640807/share-facebook-or-line-with-onclick-function-but-get-seo-problem-links-are-not" data-url="http://www.facebook.com/share.php?u=" data-windowName="" data-settings="menubar=no,toolbar=no,resizable=no,scrollbars=yes,height=700,width=550" title="Facebook Share" aria-label="Facebook Share">Facebook</a>

<a class="sharer" href="http://line.naver.jp/R/msg/text/?Page title%0Ahttps://stackoverflow.com/questions/64640807/share-facebook-or-line-with-onclick-function-but-get-seo-problem-links-are-not" data-url="http://line.naver.jp/R/msg/text/?Page title%0A" data-windowName="Share with Line"  data-settings="height=700,width=550" title="Line Share" aria-label="Line Share">Line</a>

<h2>fallback behaviour</h2>
<p>The below shows how the link behaves with no javascript</p>

<a href="http://www.facebook.com/share.php?u=https://stackoverflow.com/questions/6464080
answered Feb 20 by narikkadan
• 10,840 points

Related Questions In Others

0 votes
1 answer
0 votes
1 answer

Problem with yoast SEO

This is (probably) not a problem of ...READ MORE

answered Feb 10 in Others by narikkadan
• 10,840 points
28 views
0 votes
1 answer

how to show the <meta> values of yoast seo with some function?

check this folder : wordpress-seo\src\presenters\open-graph you can ...READ MORE

answered Feb 10 in Others by narikkadan
• 10,840 points
67 views
0 votes
0 answers

Yoast SEO/Facebook OG: Image not displaying after fb url change

i recently changed the name of my ...READ MORE

Feb 14 in Others by Kichu
• 19,040 points
56 views
0 votes
2 answers

Text console for development in JAWS?

Hey @eatcodesleeprepeat, you could use Jaws Braille viewer ...READ MORE

answered Apr 3, 2019 in AWS by Kalgi
• 52,350 points
477 views
0 votes
0 answers
0 votes
0 answers

H2 comes before h1 in source, Is it ok?

IF i use <h2> for left sidebar ...READ MORE

Mar 11 in Digital Marketing by Kichu
• 19,040 points
92 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP