Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何使用变量创建适当的iframe_Html_Youtube - Fatal编程技术网

Html 如何使用变量创建适当的iframe

Html 如何使用变量创建适当的iframe,html,youtube,Html,Youtube,我试图为Youtube嵌入视频创建一个标记,其中src来自数据库的变量值 标签如下所示: <iframe class="img-fluid w-100" width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLx0sYbCqOb8TBPRdmBHs5Iftvv9TPboYG" frameborder="0" allow="autoplay; encrypted-media" allowfu

我试图为Youtube嵌入视频创建一个标记,其中src来自数据库的变量值

标签如下所示:

<iframe class="img-fluid w-100" width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLx0sYbCqOb8TBPRdmBHs5Iftvv9TPboYG" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
<iframe class="img-fluid w-100" width="560" height="315" src="{{frontPageConfig.recentVideos2.linkURL}}"
            frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>

我试着这样替换它:

<iframe class="img-fluid w-100" width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLx0sYbCqOb8TBPRdmBHs5Iftvv9TPboYG" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
<iframe class="img-fluid w-100" width="560" height="315" src="{{frontPageConfig.recentVideos2.linkURL}}"
            frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>

但无论是否使用{{variable},它都不起作用


谢谢。

您可能需要像在中一样清理URL

尽管您可以发现这些版本存在一些问题: