简体   繁体   English

在Wordpress中包括外部链接的Javascript

[英]Including external linked Javascript in Wordpress

I want to include an externally hosted function/video player on a wordpress page with little to nothing else on it. 我想在wordpress页面上包含一个外部托管的功能/视频播放器,上面几乎没有其他内容。 The function is developed and hosted by an external provider so I have no control over it. 该功能是由外部提供商开发和托管的,因此我无法控制它。 They have provided me with the following code and instructed me to copy and paste into the page, but this doesn't work. 他们为我提供了以下代码,并指示我复制并粘贴到页面中,但这不起作用。

Unfortunately I don't have any working knowledge of JS. 不幸的是,我对JS没有任何工作知识。 Is someone able to help as to what I need to do. 有人能够帮助我做些什么。 Do I need to edit some functions.php or should it be able to work as a one off post? 我需要编辑一些functions.php还是应该可以一次性使用?

<!-- Start of Brightcove Player -->

<div style="display:none">

</div>

<!--
By use of this code snippet, I agree to the Brightcove Publisher T and C 
found at https://accounts.brightcove.com/en/terms-and-conditions/. 
-->


<script language="JavaScript" type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>

<object id="myExperience" class="BrightcoveExperience">
  <param name="bgcolor" value="#FFFFFF" />
  <param name="width" value="825" />
  <param name="height" value="650" />
  <param name="playerID" value="3058468026001" />
  <param name="playerKey" value="AQ~~,AAAACjHz08E~,HgXzSoYtBYxTAjnyep2-EpPyWh7pU7Jr" />
  <param name="isVid" value="true" />
  <param name="isUI" value="true" />
  <param name="dynamicStreaming" value="true" />

</object>

<!-- 
This script tag will cause the Brightcove Players defined above it to be created as soon
as the line is read by the browser. If you wish to have the player instantiated only after
the rest of the HTML is processed and the page load is complete, remove the line.
-->
<script type="text/javascript">brightcove.createExperiences();</script>

<!-- End of Brightcove Player -->

It can be viewed on a page here: 可以在此处的页面上查看:

http://www.treforestvets.com/pet-health-videos http://www.treforestvets.com/pet-health-videos

I can see your code in the page source of the page provided in the link. 我可以在链接中提供的页面的页面源中看到您的代码。 It is commented out due to the default formatting behaviour of wordpress. 由于wordpress的默认格式化行为,已将其注释掉。

To make it work, open the editor, Remove any previous edits for that particular page and try pasting this code in Text mode of the Editor, not in the Visual mode. 要使其起作用,请打开编辑器,删除该特定页面的所有先前编辑,然后尝试以编辑器的“ Text模式而不是“ Visual模式粘贴此代码。

After that save it and it will start working. 保存后,它将开始工作。

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

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