jQuery .load PHP进入Div-无法正常工作- [英] jQuery .load PHP into a Div -not working-

查看:132
本文介绍了jQuery .load PHP进入Div-无法正常工作-的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个很棒的资源,在我的第一个网站开发项目中,我一直在广泛使用它.

This is a fantastic resource and I have been using it extensively during my first website developing project.

我有一些静态网页,我想保持静态,但是将WordPress(已安装并在/blog/子域中运行)引入到指定div内的静态主页上.我找到了代码:

I have static webpages that I want to maintain static but introduce WordPress (already installed and running on a /blog/ subdomain) onto the static homepage within a specified div. I found the code:

<script typ="text/javascript">
    $(document).ready(function(){
         $("#randomdiv").load("load.php");
    });
</script>

我将"#randomdiv"修改为"#myblog",将"load.php"修改为WordPress添加的"blog/index.php"文件.我还指定要从index.php #content.

Which I modified from "#randomdiv" to "#myblog" and "load.php" to the "blog/index.php" file that WordPress added. I'm also specifying that I want #content from index.php.

<script typ="text/javascript">
    $(document).ready(function(){
         $("#myblog").load("blog/index.php #content");
    });
</script>

<div id="myblog" class="grid_8">
"Loading..."
</div>

踢球者:它昨晚工作了大约一个小时.我正在为静态页面的CSS设计样式中的php,它停止工作了!我已经清理了一切,重新开始,但是没有运气.我要去哪里错了??

The kicker: it worked for about an hour last night. I was styling the php in the CSS for my static page and it stopped working! I have cleared everything and started over but no luck. Where am I going wrong???

-谢谢您的回复-

也许有人可以快速轻松地向我解释.php的工作原理. WordPress在/blog/中给了我大约15个.php文件,我认为index.php是我的门票,但也许不是.尽管如此,这在晚上仍然有效.我发布了一个新帖子,它出现了,我正在为它做所有样式.发生了一些变化,我找不到它.

Maybe someone can quickly and easily explain to me how .php works. WordPress gives me about 15 .php files inside /blog/ and I assumed index.php was my ticket, but maybe not. Still, lat night this worked. I posted a new post and it appeared, I was styling it and everything. Something has shifted and I can't find it.

推荐答案

WordPress将我的index.php放在http:///... com/blog/index.php而不是http://www ... com /blog/index.php.

WordPress was placing my index.php at http:/ / ... com/blog/index.php instead of http:/ /www ... com/blog/index.php.

我进入WordPress仪表板,导航到设置,然后将WordPress地址(url)和站点地址(url)更改为包含"www".

I went into my WordPress dashboard, navigated to settings, and changed WordPress address (url) and site address (url) to include "www".

这篇关于jQuery .load PHP进入Div-无法正常工作-的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆