Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/16.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
使用jQuery过滤器在colorbox中打开vimeo url_Jquery_Regex_Embed_Vimeo - Fatal编程技术网

使用jQuery过滤器在colorbox中打开vimeo url

使用jQuery过滤器在colorbox中打开vimeo url,jquery,regex,embed,vimeo,Jquery,Regex,Embed,Vimeo,我想使用jQuery扫描一个html页面——在本例中由WordPress创建,以查找用户通过WP编辑管理员添加到vimeo vidoes的所有链接 然后我想将这些链接的控制权传递给colorbox jQuery选择器使用以下链接: 但是,vimeo将内容推出iframe并重新加载页面-因此我需要一个与此url匹配的正则表达式-可以通过iframe嵌入: 不这样做-有什么想法吗 注意:我显然需要一个循环来检查多个vimeo链接 谢谢 试试这个(未经测试)>> 谢谢,但我看不出有什么关系。。最后

我想使用jQuery扫描一个html页面——在本例中由WordPress创建,以查找用户通过WP编辑管理员添加到vimeo vidoes的所有链接

然后我想将这些链接的控制权传递给colorbox

jQuery选择器使用以下链接:

但是,vimeo将内容推出iframe并重新加载页面-因此我需要一个与此url匹配的正则表达式-可以通过iframe嵌入:

不这样做-有什么想法吗

注意:我显然需要一个循环来检查多个vimeo链接

谢谢

试试这个(未经测试)>>


谢谢,但我看不出有什么关系。。最后,我使用了oembed,因为这可能更简单,但目前似乎需要WP中的短代码。。。但是它是有效的。@QLStudio-我不确定我们是否清楚您到底想要解析什么。我相信您正在尝试找出从短url版本到长url版本的重定向url,上述答案随解决方案而来。如果这不是你想要的,你应该通过编辑更多的细节和/或例子来澄清你的问题。好的-所以我刚刚了解了一些关于软件如何工作-现在有100%的费率-谢谢!!
// vimeo in colorbox ##
jQuery("a").filter(function(){ // filter all as ##
    return jQuery(this).text().match(/vimeo\.com/igm); // match text with vimeo.com ##
    }).colorbox({iframe:true, innerWidth: "80%", innerHeight: "80%"}) // assign to colorbox ##
    .addClass("button vimeo"); // add class to style ##
match(/player.vimeo\.com/);
jQuery("a").filter(function() {
    return jQuery(this).text().match(/vimeo\.com/igm);
  }).each(function() { 
    this.setAttribute("href", this.getAttribute("href")
    .replace(/^https?:\/\/(?:www\.|)vimeo\.com\/(\d+)$/i,
      "http://player.vimeo.com/video/$1")); 
  }).colorbox({iframe:true, innerWidth: "80%", innerHeight: "80%"})
  .addClass("button vimeo");