搜索引擎是否会在Bootstrap选项卡中查看我动态创建的内容? [英] Are search engines going to see my dynamically created content in Bootstrap tabs?
问题描述
我有一个页面 index.php
,其中包含3个Bootstrap标签,对于每个标签,我在用户点击它后会生成其内容。
例如:
I have a page index.php
with 3 Bootstrap tabs in it, and for each tab I am generating its content after user clicks on it.
For example:
- 当页面加载时我将执行SQL查询,它将仅从第一个选项卡获取数据库中的数据。
- 当用户点击第二个标签时,我正在执行一个查询,该查询将获取数据并在选定的标签中显示。
这是好方法吗?当谷歌索引包含所有这些标签的页面时,Google是否也会看到所有数据?由于性能问题,我不想一次性提取所有数据。
Is this good approach? Is Google going too see all that data when it index the page containing all this tabs? I do not want to pull all data at once because of performance issues.
这是我的示例代码,所以请告诉我这是否是一个好方法:
Here is my sample code, so please tell me if this is a good approach:
index.php
file:
<!DOCTYPE html>
<html>
<head>
<title>Tabs demo</title>
<!-- Latest compiled and minified CSS -->
<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>
<!-- jQuery library -->
<script src="//code.jquery.com/jquery-2.1.4.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</body>
</html>
恐怕搜索引擎不会看到第二个和第三个标签内容。或者至少他们不会将它们与index.php页面联系起来。我错了吗?
I am afraid that search engines will not see second and third tabs contents. Or at least they will not relate them with index.php page. Am I wrong?
推荐答案
不,如果标签下的内容是,我们(Google)将看不到标签背后的内容动态生成(即不仅仅是隐藏)。
No, we (Google) won't see the content behind tabs iff the content under the tab is dynamically generated (i.e. not just hidden).
您还可以在Search Console(以前的网站管理员工具)中使用Google抓取方式查看我们看到的内容。在我们的标题为使用Fetch渲染页面的文章中详细了解该功能谷歌的。
You can also see what we "see" using Fetch as Google in Search Console (former Webmaster Tools); read more about the feature in our post titled Rendering pages with Fetch as Google.
这篇关于搜索引擎是否会在Bootstrap选项卡中查看我动态创建的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!