日期:2014-05-17 浏览次数:20582 次
<!DOCTYPE html>
<html>
<head>
<title>jQuery</title>
<script type="text/javascript" src="/script/jquery-1.4.2.min.js"></script>
</head>
<body>
<iframe id="main" name="main" src="http://www.baidu.com" width="100%" height="100%" frameborder="0" scrolling="auto"></iframe>
</body>
<script type="text/javascript">
$(function(){
$('#main').attr('src', 'http://www.163.com');
});
</script>
</html>
------解决方案--------------------
<iframe id="Main" style="visibility: inherit" name="Main" src="temp.aspx" frameborder="0"
scrolling="auto" width="100%" height="100%" runat="server"></iframe>
------解决方案--------------------
document.getElementById("main").src=url;
百分百可以。。
用jq 是不行的。。
------解决方案--------------------
这个用js就可以,浏览器兼容也不会有问题。
document.getElementById("main").src=url;
jquery如果没有必要先不要使用,尽量用js去完成。