[英]How to add a 3rd party Jquery Library in React Functionnal component?
[英]Joomla add 3rd party component
我試圖通過將所有文件從public復制到 Joomla 本地文件夾來將一個svelte應用程序包含到Joomla站點中,並且在 Joomla 中,我創建了一篇帶有腳本的文章,其中包含此index.html
苗條的輸出
+---public
| | favicon.png
| | index.html
| | output.doc
| |
| \---build
| bundle.css
| bundle.css.map
| bundle.js
| bundle.js.map
用於包含 index.html 的 Joomla 腳本
{source}
<?php ini_set("include_path", "/var/www/vhosts/examplesite.com/httpdocs/files/forms/public"); ?>
<?php include 'index.html'; ?>
{/source}
在本地,當我從公眾發布 index.html 時,一切正常,Joomla noop 中的 bun。 錯誤是 Joomla 無法從構建文件夾中找到文件,例如在index.html中包含bundle.css,如下所示:
<script defer src='./build/bundle.js'></script>
我預計bundle.js 的完整路徑是:
https://www.examplesite.com/files/forms/public/bundle.js
但實際上,瀏覽器需要它來自
https://www.examplesite.com/bundle.js
因此,構建文件夾中所有文件的路徑存在問題。 幫助 !!!
如果你這樣做
<script defer src='./build/bundle.js'</script>
瀏覽器確實會嘗試從您提到的位置獲取它,這是因為./
部分表示根並使其成為絕對路徑。
將您的標記更改為:
<script defer src='/build/bundle.js'</script>
讓它搜索相對於當前位置的包文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.