Php Smarty:如何抓取和抓取按关键字嵌入 YouTube 视频?
请问有人可以让我看一些例子吗?真的谢谢你。 我发现了一些东西,但现在我有另一个问题: 例如,我在 tpl:
<script src="http://www.domain.com/script.js" type="text/javascript"></script>
<div id="youtubeDiv"></div>
<script type="text/javascript">
insertVideos({'block':'youtubeDiv','q':'keyword','type':'search','results':8,'order':'most_relevance','player':'embed','layout':'thumbnails'});</script>
Between {literal}{/literal} 中有以下 javascript 以使其工作...但是如何用 smarty 变量 {$product.name} 替换“关键字”???
please could someone let me see some examples? Really Thank You.
I found something but now i have another problem:
for example i have the following javascript inside a tpl:
<script src="http://www.domain.com/script.js" type="text/javascript"></script>
<div id="youtubeDiv"></div>
<script type="text/javascript">
insertVideos({'block':'youtubeDiv','q':'keyword','type':'search','results':8,'order':'most_relevance','player':'embed','layout':'thumbnails'});</script>
between {literal}{/literal} to let it work... but how to replace the "keyword" with the smarty variable {$product.name} ???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
发布评论
评论(2)
冷清清2024-11-25 07:42:35
<form onsubmit="insertVideos({'block':'youtubeDivSearch','type':'search','q':document.getElementById('ytSearchField').value,'results': 20,'order':'most_relevance','layout':'thumbnails'}); return false;">
<input id="ytSearchField" type="text" />
<input type="submit" value=" Search " />
</form>
<div id="youtubeDivSearch"></div>
<script src="http://www.yvoschaap.com/ytcp.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js" type="text/javascript"></script>
<div id="youtubeDiv"></div>
<div id="youtubeDivUser"></div>
<script>insertVideos({'block':'youtubeDivUser','type':'user','q':'','results': 20,'layout':'thumbnails','player':'embed','imgstyle':'3px solid #333'});</script>
~没有更多了~
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
好的,解决了...代替“关键字”:
ok, solved... in place of 'keyword':