如何从iframe获取内容类型? [英] How to get content-type from an iframe?

查看:131
本文介绍了如何从iframe获取内容类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法可以在与其连接的加载事件处理程序函数内部获取iframe内容的内容类型?

Is there a way to get the content-type of an iframe's content inside the load event handler function attached to it?

推荐答案

我认为这应该使用jquery来完成工作

i assume this should do the work using jquery

$('iframe').contents().contentType

在加载事件 this 中应该指向iframe dom,所以

in the load event this should point to the iframe dom so

$(this).contentType 

应该工作

这篇关于如何从iframe获取内容类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆