当前位置 : 主页 > 网络编程 > JavaScript >

jquery获取frame的src

来源:互联网 收集:自由互联 发布时间:2021-07-03
1. [代码] [JavaScript]代码 htmlheadmeta http-equiv="Content-Type" content="text/html; charset=UTF-8"title/title/headframeset rows="63,*" frameborder="no" border="0" framespacing="0"frame src="view/head.html" scrolling="no" noresize="nor

1. [代码][JavaScript]代码    

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>

<frameset rows="63,*" frameborder="no" border="0" framespacing="0">

<frame src="view/head.html" scrolling="no" noresize="noresize" frameborder="0"  />

<frameset cols="238,*" frameborder="no" border="0" framespacing="0">
    <frame id="leftPage" src="view/left.html" frameborder="0" scrolling="no" noresize="noresize" />
    <frame src="view/centerPage/phoneD.html" frameborder="0" noresize="noresize" name="showframe" />
</frameset>

</frameset>

<noframes>
<body>
</body>
</noframes>



</html>

2. [代码][JavaScript]代码    

$(function(){
    var src = $(window.parent.document).find('#leftPage')[0].src;
    console.log(src);
})
网友评论