jquery - Adding AJAX function to anchor behavior but Keeping href for SEO -
is possible have link/button execute ajax/jquery function load new content @ same time contains link page same specific content?
this seo, , concerned crawler unable index sitemap.
something not sure:
<a href="mypage.html" onclick="javascript: loadajaxcontent()" > page </a>
the overall goal create dynamic site nice effects between transition of 1 page , another. @ same time, want search engines find pages.
you need use first prevent default action tag. easiest way use jquery seen below. dont know specific html element lets assume have 1 anchor tag on page. first, once document loaded, bind click event anchor. once ancore clicked prevent default action occuring. can perform whatever action desire.
$(document).ready(function() { $('a').click(function(e) { e.preventdefault(); //perform ajax loading }); });
Comments
Post a Comment