簡體   English   中英

在Wordpress中包括外部鏈接的Javascript

[英]Including external linked Javascript in Wordpress

我想在wordpress頁面上包含一個外部托管的功能/視頻播放器,上面幾乎沒有其他內容。 該功能是由外部提供商開發和托管的,因此我無法控制它。 他們為我提供了以下代碼,並指示我復制並粘貼到頁面中,但這不起作用。

不幸的是,我對JS沒有任何工作知識。 有人能夠幫助我做些什么。 我需要編輯一些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 -->

可以在此處的頁面上查看:

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

我可以在鏈接中提供的頁面的頁面源中看到您的代碼。 由於wordpress的默認格式化行為,已將其注釋掉。

要使其起作用,請打開編輯器,刪除該特定頁面的所有先前編輯,然后嘗試以編輯器的“ Text模式而不是“ Visual模式粘貼此代碼。

保存后,它將開始工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM