我有这个:
<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/