<iframe/>或者<frame>里面用主页面的东西,就是top.xxx

如:
<script>
  function func(){ ... };
</script>
<input type='text' id='t' />
<iframe scr='a.html'/> //a.html简单内容如下
<script>
top.document.getElementById('t').value; //在a.html中取input的值
top.func(); //在a.html中执行func()
</script>

JS中的top是什么?的更多相关文章

  1. Js中 关于top、clientTop、scrollTop、offsetTop的用法

    网页可见区域宽: document.body.clientWidth;网页可见区域高: document.body.clientHeight;网页可见区域宽: document.body.offset ...

  2. Js中 关于top、clientTop、scrollTop、offsetTop等

    网页可见区域宽: document.body.clientWidth;网页可见区域高: document.body.clientHeight;网页可见区域宽: document.body.offset ...

  3. Js中 关于top、clientTop、scrollTop、offsetTop

    网页可见区域宽: document.body.clientWidth; 网页可见区域高: document.body.clientHeight; 网页可见区域宽: document.body.offs ...

  4. js-分享107个js中的非常实用的小技巧(借鉴保存)

    转载原文:http://***/Show.aspx?id=285 1.document.write(""); 输出语句 2.JS中的注释为// 3.传统的HTML文档顺序是:doc ...

  5. js中一些常用的基本函数

    如何使用jquery刷新当前页面下面介绍全页面刷新方法:有时候可能会用到window.location.reload()刷新当前页面.parent.location.reload()刷新父亲对象(用于 ...

  6. (网页)JS中的小技巧,但十分的实用!

    转自CSDN: 1.document.write(”"); 输出语句2.JS中的注释为//3.传统的HTML文档顺序是:document->html->(head,body)4. ...

  7. JS中常用的语法

    在做前端中,JS的语法尤为重要..没有它,就没有你的未来吧.. 下面将一些常用的JS语法给大家罗列出来.. 也给自己备份一下.. 以备不时之需.. 1.输出语句:document.write(&quo ...

  8. 关于js中window.location.href,location.href,parent.location.href,top.location.href的使用方法

    关于js中"window.location.href"."location.href"."parent.location.href".&qu ...

  9. js中不同的height, top的对比

    每次看到js中的clientHeight(clientTop), offsetHeight(offsetTop),scrollHeight(scrollTop)就头大,根本分不清这几种的区别,然而碰到 ...

随机推荐

  1. python类定义

    在我的收藏中有一篇特别详细的类讲解 此处部分内容引自:http://blog.sina.com.cn/s/blog_59b6af690101bfem.html class myclass: 'this ...

  2. 【一天一道LeetCode】#70. Climbing Stairs

    一天一道LeetCode 本系列文章已全部上传至我的github,地址:ZeeCoder's Github 欢迎大家关注我的新浪微博,我的新浪微博 欢迎转载,转载请注明出处 (一)题目 You are ...

  3. Linux 操作之基础命令

    1.罗列出文件和文件夹 –ls ls 是帮助我们罗列出当前目录下的所有的文件和文件夹,当然了,还可以加上许多选项,最为重要的是所加的参数可以进行组合,起到让人意想不到的效果,下面就是常用的一些ls的及 ...

  4. Unity UGUI图文混排源码(一)

    Unity UGUI图文混排源码(一):http://blog.csdn.net/qq992817263/article/details/51112304 Unity UGUI图文混排源码(二):ht ...

  5. 10_Android中通过HttpUrlConnection访问网络,Handler和多线程使用,读取网络html代码并显示在界面上,ScrollView组件的使用

     编写如下项目: 2 编写Android清单文件 <?xml version="1.0" encoding="utf-8"?> <mani ...

  6. Android listView异步下载和convertView复用产生的错位问题

    1:Item图片显示重复 这个显示重复是指当前行Item显示了之前某行Item的图片. 比如ListView滑动到第2行会异步加载某个图片,但是加载很慢,加载过程中ListView已经滑动到了第14行 ...

  7. ORM对象关系映射之GreenDAO高级用法

    CRUD 增加: dao.insert(Student entity);//添加一个 dao.insertInTx(Student... entity);//批量添加 删除: dao.deleteBy ...

  8. 【Android 应用开发】GitHub 优秀的 Android 开源项目

    原文地址为http://www.trinea.cn/android/android-open-source-projects-view/,作者Trinea 主要介绍那些不错个性化的View,包括Lis ...

  9. OpenGL Shader Key Points (1)

    1.  Shader起步 1.1.  可编程管线 仅考虑Vertex shader和fragment shader: 1.2.  Shader Object 在编译阶段生成,把shader源代码编译成 ...

  10. CMake添加-D_DEBUG宏

    Linux下Debug版不会自动添加 _DEBUG宏,只有NDEBUG宏可用. cmake ../src _DCMAKE_BUILD_TYPE=Debug -D_DEBUG 会报错: -D_DEBUG ...