0
看一看这段代码:如何获取iframe元素的实际代码(不是内部内容)?
var foo = '<iframe width="560" height="315" src="http://www.youtube.com/embed/A175-KHvfy4" frameborder="0" allowfullscreen></iframe>';
foo = $(foo); // turned into jquery object
alert(foo.html()); // alerts nothing
alert(foo[0]); // alerts [Object HTMLIFRAMELEMENT] but how can I get the actual iframe code as a string?
所以,我怎样才能从jQuery对象的iframe代码?
我真的想这样的:
<iframe width="560" height="315" src="http://www.youtube.com/embed/A175-KHvfy4" frameborder="0" allowfullscreen></iframe>
,而无需访问原来的变种。