发布于 2016-12-30 08:24:45 | 193 次阅读 | 评论: 0 | 来源: 网友投递
这里有新鲜出炉的Javascript教程,程序狗速度看过来!
JavaScript客户端脚本语言
Javascript 是一种由Netscape的LiveScript发展而来的原型化继承的基于对象的动态类型的区分大小写的客户端脚本语言,主要目的是为了解决服务器端语言,比如Perl,遗留的速度问题,为客户提供更流畅的浏览效果。
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>
<body>
<iframe src="http://www.b.com/b.html" ></iframe>
<ul id="getText"></ul>
<script>
function dosome(text){
document.getElementById("getText").innerHTML= decodeURI(text);
}
</script>
</body>
</html>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>
<body>
<iframe id="myfarme" src="###"></iframe>
<ul id="ct">
<li>这里是内容1</li>
<li>这里是内容2</li>
<li>这里是内容3</li>
<li>这里是内容4</li>
<li>这里是内容5</li>
<li>这里是内容6</li>
</ul>
<script>
window.onload = function(){
var text = document.getElementById('ct').innerHTML;
document.getElementById('myfarme').src="http://www.a.com/c.html?content="+encodeURI(text);
}
</script>
</body>
</html>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<script>
window.onload = function(){
var text = window.location.href.split('=')[1]
console.log(parent.parent)
parent.parent.dosome(text);
}
</script>
</head>
<body>
ddddddddddd
</body>
</html>