javascript - 使用 jquery 解开视频标签

标签 javascript jquery video tags forced-unwrapping

我有这个:

<div class="vid">

<video> bla bla bla </video>

</div>

我必须解开这个视频标签,所以我尝试了:

$( "video" ).unwrap();

控制台窗口中的结果是:

TypeError: undefined is not a function
message: "undefined is not a function"
stack: (...)
get stack: function () { [native code] }
set stack: function () { [native code] }
__proto__: Error

有什么线索吗?

非常感谢!

最佳答案

似乎$未定义。你确定 jQuery 已经加载了吗?

您可以尝试console.log这些:

console.log(window.jQuery); // What's the output of this?
console.log($); // What's the output of this? 
console.log(jQuery('video')); // What's the output of this? 

这是调试问题的好方法。

关于javascript - 使用 jquery 解开视频标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25530547/

相关文章:

javascript - 单击另一个元素后关闭元素

python - 为什么 VideoClip 的帧在写入视频文件时会发生变化?

javascript - 单页应用 Nginx Django Python 和端口转发

javascript - ReactJs在optgroup中显示数据

javascript - 每个函数获取差异数组的最大值

javascript - jQuery - 选择以...开头和结尾的元素,但省略特定名称

c# - 快速视频显示 WPF

ios - iPhone 上的 HTML5 视频自动播放

javascript - 我如何在 JavaScript 中准备嵌套键值对列表

javascript - 复选框禁用上的 jquery 事件监听器