jQuery .load()Wordpress内容到Div -ot在其他计算机上工作 -

时间:2012-02-17 08:37:23

标签: jquery wordpress

我上周问过一个关于使用jQuery将wordpress内容加载到div中的问题 - 它就像一个魅力。我有它的样式,装载在我的电脑和我的手机上,但它不会加载到任何其他人的机器上。我无法弄清楚为什么。有人请新眼睛看看吗?非常感谢你。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

    <title>untitled</title>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

</head>

<body>
    <div id="myblog">
        <p>Loading...</p>
    <script type="text/javascript">
$(document).ready(function(){
$("#myblog").load("http://www.zephyrdesigns.com/blog/index.php #content");
});
    </script>
    </div>
</body>
</html>

为什么它会在我的机器上正确加载?是因为我的机器上安装了jQuery吗?为什么它在我的手机上正确加载?为什么它不会加载到其他地方?

最后一期:博客文章位于http://www.zephyrdesigns.com/blog(根据地址栏),但我认为index.php文件是项目的来源(并且它在我的本地网站上有效[当然已上传]允许ajax命令在jQuery中工作)。 .php在这方面的工作方式不同吗?我抓错了.php文件吗?

1 个答案:

答案 0 :(得分:0)

当您提出此请求时,您的Web服务器将返回“301 Moved Permanently”错误,并在Mozilla Firefox中使用Firebug进行测试。您的服务器设置可能会禁用热链接吗?