Tag: match

PHP:用querystring替换匹配的文本

我有一个像经文这样的缩写列表: Mt=80 Lu=81 Rv=92 Nd=95 etc. 我目前正在jquery转换这些链接: Mt 5: 2 Nd 14: 25 并使它们如下: Mt 5: 2 Nd 14: 25 用于此的脚本是: $(document).ready(function() { $(“a[href=’page.php’]”).each(function(index, element){ href = $(element).attr(‘href’); // get the href text = $(element).text().split(‘ ‘); // get the text and split it with space $(element).attr(‘href’, href + “?book=” +$.trim(text[0])+”&chapter=”+$.trim(text[1].slice(0,-1))+”&vmin=”+$.trim(text[2])); //create desired href and replace […]

使用Jquery&.match()获取youtubevideoID

我需要一点推动,因为我几乎可以工作。 我想给jquery提供一个URL,并让它除了videourl之外。 这是我的代码: var url = ‘http://www.youtube.com/watch?v=bxp8NWvIeSo’; $results = url.match(“[\\?&]v=([^&#]*)”); alert($results); }); 我将此作为输出 – ?V = bxp8NWvIeSo,bxp8NWvIeSo 当我只想要的时候 bxp8NWvIeSo