Похожие чаты

Hi. I'D like to have AJAX + SEO for a single

page app (E-commerce website).
Please suppose I have anchor tags with href="url" for SEO, but I want to get new HTML content (a section of page) from the server by SSR (server side rendering).
Example:
In this example I want to replace new HTML content (static page provided by server by ssr) inside div, but its trigger is anchor tag.

<a href="url" onClick="myAjaxFunction(url)">text</a>
<div id="my-ajax-html-answer"></div>
<script>

$(document).ready(function(){

$('a').click(function(e){
e.preventDefault(); //disable href for all anchor tags
});

});


function myAjaxFunction(url){
$("#my-ajax-html-answer").load(url);
}

</script>

Is this approach true for SEO?

3 ответов

17 просмотров
TelArmy- Автор вопроса

No answer?😒

If you're assuming that the crawler doesn't have js support (which is possible) this solution won't work And if it does, it can just crawl the spa 🤔

TelArmy- Автор вопроса
Spherical Flying Kat 丸い飛んでる猫
If you're assuming that the crawler doesn't have j...

I did not understand what you mean exactly. I'm a java developer not javascript. I think with my scenario, google crawler can read anchor tag (because they have href attribute). But I'm disabling them by javascript code (`preventDefault`). Therefore I can use `onClick` in my anchor tags to use ajax. My ajax response in the server is a HTML text that will be placed instead of the selected tag in my client (here div with `my-ajax-html-answer` id). So I think this is SEO friendly. Are you agree?

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта