gpt4 book ai didi

javascript - SEO 是否读取从 AJAX 加载的数据?

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:47:52 25 4
gpt4 key购买 nike

我用 Ajax 加载了标题、描述和关键字,加载程序后,数据是用 php 从我的数据库加载的。问题是,SEO 是否从我的代码中读取了标题、描述和关键字?

这是我加载头部元素的 JS 函数

function addHead(page)
{
$.ajax({
url:"php/content_head.php",
type:"POST",
data:"page="+page,

success: function(reponse){
result = JSON.parse(reponse);
$("title").text(result["Title"]);
var headL = document.getElementById("head");
headL.innerHTML+='<meta name="description" content="'+result["Desc"]+'">';
headL.innerHTML+='<meta name="keywords" content="'+result["Keywords"]+'">';
headL.innerHTML+='<meta name="author" content="Softmagazin">';
}
});
}

这是 PHP 数据

<?php

include "connect.php";
include "config.php";
include "functions.php";

$data = array();

$page = $_POST["page"];
$tabel = $GLOBALS['tabel_pagini'];
$sql = "SELECT * FROM $tabel WHERE Pagina = '$page'";

$result = $conn->query($sql);
$row = $result->fetch_assoc();

$data["Title"] = $row["Titlu"];
$data["Desc"] = $row["Descriere"];
$data["Keywords"] = $row["CuvinteCheie"];

echo json_encode($data);

?>

最佳答案

虽然过去是这样,但谷歌的机器人最近变得“更聪明”了。他们的抓取工具应该能够很好地看到您的页面。如果您仍然担心或只想亲自看看,请尝试下载 Lynx 并查看您的页面呈现方式。

来自 Google 网站管理员帮助网站 Crawling and Indexing FAQ :

Q: My website uses pages made with PHP, ASP, CGI, JSP, CFM, etc. Will these still get indexed?

A: Yes! Provided these technologies serve pages that are visible in a browser, Googlebot will generally be able to crawl, index and rank them without problems. We have no preference, they're all equivalent in terms of crawling, indexing and ranking as long as we can crawl them. One way to double-check how a search engine crawler might see your page is to use a text-only browser such as Lynx to view your pages.

关于javascript - SEO 是否读取从 AJAX 加载的数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43122252/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com