这篇文章主要介绍了jquery得到iframe src属性值的方法,很简单,很实用,需要的朋友可以参考下
取得iframe src属性的的值:
Html代码
<!DOCTYPE HTML>
<
html
>
<
head
>
<
meta
http-equiv
=
"Content-Type"
content
=
"text/html; charset=utf-8"
/>
<
title
>jquery</
title
>
<
style
type
=
"text/css"
>
</
style
>
<
script
type
=
"text/javascript"
src
=
"http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"
></
script
>
<
script
type
=
"text/javascript"
>
$(document).ready(function (){
var dk = $(window.parent.document).find("#iframe_id").attr("src");
alert(dk);
});
</
script
>
</
head
>
<
body
>
<
iframe
id
=
"iframe_id"
name
=
"iframe_name"
src
=
"http://www.baidu.com"
></
iframe
>
</
body
>
</
html
>
时间: 2024-10-17 23:32:24