简体   繁体   English

WordPress JavaScript 403错误

[英]WordPress JavaScript 403 Error

I wrote a real quick javascript file in NotePad++, and I am scratching my head about this 403 error I'm getting as I try to load it. 我在NotePad ++中编写了一个真正的快速javascript文件,当我尝试加载它时遇到的这个403错误让我head之以鼻。 Note that everything else associated with my WordPress install and the various plugins I have acquired are working perfectly. 请注意,与我的WordPress安装相关的所有其他操作以及我获得的各种插件都可以正常工作。 I also have yet to use any security plugins since I'm currently running my website in WAMP localhost. 由于我当前正在WAMP本地主机中运行我的网站,因此我还没有使用任何安全性插件。 I changed the file to 755 using Cygwin's chmod, but that didn't help. 我使用Cygwin的chmod将文件更改为755,但这没有帮助。 The file is currently in my theme's directory, and I am trying to embed it into the bottom of a single page. 该文件当前位于主题的目录中,并且我试图将其嵌入到单个页面的底部。 The methodology I am using is described here ( https://codex.wordpress.org/Using_Javascript ), and, specifically, this is all I have done: 我正在使用的方法在此处( https://codex.wordpress.org/Using_Javascript )中进行了描述,具体地说,这就是我所做的一切:

<script type="text/javascript" src=/mysite/wp content/themes/RainForest/slider.js"></script>
<script type="text/javascript">
<!--
test();
//--></script>

I also tried replacing the "slider.js" with another javascript file that is 200 when ran inside a PHP file, and it too got a 403 error when I tried to run it inside the content of a page. 我还尝试用另一个在JavaScript文件中运行的javascript文件替换“ slider.js”,该文件在PHP文件中运行时为200,当我尝试在页面内容中运行它时,它也出现403错误。 Has anyone else ran into this problem? 还有其他人遇到过这个问题吗? What, if anything, could I be missing here? 我会在这里想念什么(如果有的话)?

You have a space in wp content instead of a dash like wp-content . wp content有空格,而不是wp-content等破折号。 You are also missing the starting double quote: 您还缺少起始双引号:

src="/mysite/wp-content/themes/RainForest/slider.js"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM