I have an index.php page with three Bootstrap tabs in it, and for each tab I create its contents after the user clicks on it.
For example:
- When the page is loaded, I will execute an SQL query that will receive data from the database for the first tab only.
- When the user clicks on the second tab, I execute a query that will receive data and display it on the selected tab.
Is this a good approach? Is Google going to see all this data when it indexes a page containing all of these tabs? I do not want to retrieve all the data at once due to performance issues.
Here is my sample code, so please tell me if this works:
index.php file:
<!DOCTYPE html> <html> <head> <title>Tabs demo</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> </head> <body> <div class="container"> <ul class="nav nav-tabs"> <li class="active"><a data-toggle="tab" href="#home">Home</a></li> <li><a data-toggle="tab" href="#menu1">Menu 1</a></li> <li><a data-toggle="tab" href="#menu2">Menu 2</a></li> </ul> <div class="tab-content"> <div id="home" class="tab-pane fade in active"> <h3>HOME</h3> <p>Some content.</p> </div> <div id="menu1" class="tab-pane fade"> <?php $model = [ 0 => ['title' => 'First item', 'content' => 'Some first content'], 1 => ['title' => 'Second item', 'content' => 'Some second content'] ]; ?> <?php foreach ($model as $data): ?> <h3><?= $data['title'] ?></h3> <p><?= $data['content'] ?></p> <?php endforeach ?> </div> <div id="menu2" class="tab-pane fade"> <h3>Menu 2</h3> <p>Some content in menu 2.</p> </div> </div> </div> <script src="//code.jquery.com/jquery-2.1.4.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> </body> </html>
Iโm afraid that search engines will not see the contents of the second and third tabs. Or at least they wonโt link them to the index.php page. I'm wrong?
javascript seo search-engine twitter-bootstrap tabs
offline Jul 26 '15 at 14:06 2015-07-26 14:06
source share