1

We have developed a website and it uses JavaScript library to query database and display the data in HTML page. When you go to the website, you need to search for something in order to retrieve the data. so by default website doesn't display any data and it needs users to perform action.
The search result data is not visible in HTML view source as it uses JavaScript.
So, the search engines have no visibility as to what our website used for and data used in order to redirect more visitors.

Secondly, I wonder how search bots/engine crawl the websites with non-static content and understand enough about the website to redirect users.

greybeard
  • 2,249
  • 8
  • 30
  • 66
user1439582
  • 103
  • 2
  • 14
  • I don't see anything in the question relating to the title. Please make sure you either add more details or change the title of the question. – Reality Jan 06 '21 at 20:07

2 Answers2

1

from what i see from your question what you need to do is send requests to your server to query data from your database and show it to you client in real-time.For that i would recommend that you use web sockets(such as socket.io) or AJAX so that you could update your website seamlessly

codeboi
  • 150
  • 1
  • 9
  • Please give some more details as to how that would work. As a picture is a thousand words, so is clarity to a thousand thank-you's. – Reality Jan 06 '21 at 20:10
  • That's much better, although I wouldn't recommend sockets for that, as web sockets are more for frequent and short requests (like chat posts). – Reality Jan 06 '21 at 20:15
1

From what I have researched, crawlers actually don't read dynamic content. Instead, they use this technique called dynamic rendering.

Dynamic rendering has to do with the server itself. It checks each request and if it determines it to be a bot, then it will send static HTML content to the bot. Otherwise, it will send normal dynamic content to the user.

Also, google and other search engines make use of meta tags. With meta tags you can define a short description of the webpage which will oftentimes be shown in the search results page.


As for question in the title, you would need to send the search information to a server. From there, you would process the data server-side and send the results back to the client where JavaScript would render it based off of the results.

You should use AJAX for this.

Resources:

Reality
  • 637
  • 1
  • 6
  • 25