我正在尝试让我的 jQuery 脚本从单击的链接中提取 url,然后将其插入到我的视频标签中。有什么建议吗?
我试过拼接我从 .html() 得到的东西,但引号总是搞砸了。
<div class="binShadow">
<div class="bin">
<table id="tableBin" border="0">
<tr>
<th>name</th>
<th>description</th>
<th>location</th>
<th>duration</th>
</tr>
<tbody>
<tr>
<td><a href='clip1234.mov'>Clip1234</a></td>
<td>dolor sit amet, consectetur adipiscing elit</td>
<td>dr101</td>
<td>:60</td>
</tr>
<tr>
<td><a href="clip456.mov">Clip456</a></td>
<td>Lorem ipsum dolor sit amet</td>
<td>dr101</td>
<td>:60</td>
</tr>
</tbody>
</div>
</table>
</div>
</div>
</div>
<script>
$("#tableBin").click(function () {
var url = $(this).html(); //Not even close to working
var overlay = jQuery('<div class="boxWrapper"><div class="box"><video src="'+url+'"</div></div>');
overlay.appendTo(document.body);
});
</script>