Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/14.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
将PHP变量传递到嵌入Vimeo链接的Javascript字符串中_Php_Javascript_Video_Vimeo - Fatal编程技术网

将PHP变量传递到嵌入Vimeo链接的Javascript字符串中

将PHP变量传递到嵌入Vimeo链接的Javascript字符串中,php,javascript,video,vimeo,Php,Javascript,Video,Vimeo,我试图将一个PHP变量从Wordpress自定义字段传递到一个javascript字符串中。 自定义字段包含一个Vimeo视频的ID号,它需要放在中间,在点击时替换一个图像。代码如下: jQuery("#index-image").click(function(){ jQuery(this).replaceWith('<div id="video-container"><iframe id="videoframe" src="http://player.vimeo.c

我试图将一个PHP变量从Wordpress自定义字段传递到一个javascript字符串中。 自定义字段包含一个Vimeo视频的ID号,它需要放在中间,在点击时替换一个图像。代码如下:

jQuery("#index-image").click(function(){

    jQuery(this).replaceWith('<div id="video-container"><iframe id="videoframe" src="http://player.vimeo.com/video/"<?php echo $page_videos[$i]; ?>"color=ffffff&portrait=0&byline=0&title=0&autoplay=1&api=1&player_id=videoframe" frameborder="0" style="width: 100%;" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>');
jQuery(“#索引图像”)。单击(函数(){

jQuery(this).replaceWith('在我看来,变量在src属性之外进行了回显

    jQuery(this).replaceWith('<div id="video-container"><iframe id="videoframe" src="http://player.vimeo.com/video/<?php echo $page_videos[$i]; ?>&color=ffffff&portrait=0&byline=0&title=0&autoplay=1&api=1&player_id=videoframe" frameborder="0" style="width: 100%;" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>');

jQuery(this).replaceWith('验证
$page\u视频[$i]不是空的。因为只要你安装了PHP,<代码> <代码>就会生效。我已经把字符串建立成变量,并创建了一个返回正确字符串的警报。浏览器似乎没有在HTML中确认变量。它返回中间没有变量的字符串。http://player.vimeo.com/video/&color=ffffffff&trait=0&byline=0&title=0&autoplay=1&api=1&player\u id=videoframe
这就是你问题帖子中的整个src链接。php回音用双引号括起来。这会在id的php回音之前破坏source属性var\u dump($page\u videos)返回什么?