【发布时间】:2014-01-14 21:06:36
【问题描述】:
我在 css-tricks 上提出了这个问题,但只得到了我在子函数文件中实现的一个响应,但它仍然无法正常工作,您可以在此处查看该线程:http://css-tricks.com/forums/topic/i-need-help-getting-my-javascript-file-to-work-on-wordpress-through-child-theme/#post-160138
在我的 wordpress 页面中,您可以在底部看到:http://izaguirre.me/contact/ 我在 html 中有这个:
<div id="myDiv">
These Are Radom Letters To Test The Connection Of the JAVA File DSFDFSFSDFF
</div>
在我的子主题的 myscript.js 文件中,我里面唯一的代码是:
document.getElementById('myDiv').style.background = "black";
但我没有看到 JS 工作的反映,因为我放在 izaguirre.me/contact/ 页面末尾的示例中没有可见的背景变化?
【问题讨论】:
-
如果我错了,请纠正我,但这不是问题......
-
如果这看起来不像是一个问题,我深表歉意,但事实上,Matthias Lehming 给了我正确的答案,尽管我对他的回答仍有一些疑问
标签: javascript wordpress