document.write与document.getElementById.innterHTML的区别
<html>
<head>
<meta charset="utf-8">
<script>
var tmp = "<iframe src='http://www.cnblogs.com/kaituorensheng/'></iframe>";
document.write(tmp);
function getValue()
{
document.getElementById("show").innerHTML = tmp;
}
</script>
</head> <body>
<div id = "show" onclick="getValue()">click here</div>
</body>
</html>
document.write在页面导入时加载,document.getElementById.innterHTML需要事件触发。
效果
初始
点击“click here”后
document.write与document.getElementById.innterHTML的区别的更多相关文章
- document.body、document.documentElement和window获取视窗大小的区别
来源:http://www.ido321.com/906.html 在w3school关于window对象的介绍中,介绍了获取浏览器窗口大小的三种方法(浏览器的视口,不包括工具栏和滚动条). 对于In ...
- $(document).ready() 与 window.onload 之间的区别
1.执行时机 window.onload 是网页中所有的元素都加载到浏览器后才执行 $(document).ready() 是dom完全就续就可以调用 例如:如果给一副图片添加点击事件,window. ...
- 【转】document.documentElement和document.body的区别
转自:http://www.cnblogs.com/ckmouse/archive/2012/01/30/2332070.html 网页中获取滚动条卷去部分的高度,可以通过 document.body ...
- document.documentElement和document.body的区别
网页中获取滚动条卷去部分的高度,可以通过 document.body.scrollTop 来获取,比如使div跟着滚动条滚动: <div id="div" style=&qu ...
- js中的 window.location、document.location、document.URL 对像的区别(转载)
原文:http://www.cr173.com/html/18417_1.html 当我们需要对html网页进行转向的时候或是读取当前网页的时候可以用到下面三个对像: window.location. ...
- document.documentElement和document.body区别
body是DOM对象里的body子节点,即body标签, documentElement 是整个节点树的根节点root, 详细介绍请看本文,感兴趣的朋友可以参考下 区别: body是DOM对象里的 ...
- document.body 和 document.documentElement 的区别
document.body 和 document.documentElement 的区别 : www.cnblogs.com/scy251147/archive/2011/04/10/2011420. ...
- document.getElementsByName和document.getElementById用法
本文的问题在国外的一个网站得到了答案http://stackoverflow.com/questions/11235409/no-getelementbyid-for-body document.bo ...
- document.documentElement和document.body区别介绍
document.documentElement和document.body区别介绍 * 区别 body是DOM对象黎明的body子节点,即标签 docummentElement 是整个树的根节点ro ...
随机推荐
- c#帮助类:发送邮件
private static string IsOpenSendMail = ConfigurationManager.AppSettings["IsOpenSendMail"]; ...
- angular 守卫路由
import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; im ...
- .NET Framework的一些基本概念
各种Framework的区别(按在Windows程序管理中显示的名称) .NET Framework: 运行环境,仅用于运行程序 .NET Framework Developer Pack: 包含Ru ...
- k8s学习笔记(一)
你将学到什么 如何部署k8s集群 网络拓扑 主机名 网络地址 角色 study 92.0.0.50(内网) 192.168.203.250/19(外网) Master fnode 92.0.0.16( ...
- 新增扩展程序功能打包提交新版 WARNING ITMS-90473 警告问题
1.问题描述 自从在主应用中加入SiriShortCut功能之后,打包程序上传至 iTunes Connect 就会出现警告,看其原因描述是CFBundleVersion主应用与子应用的不一致导致的 ...
- 移动端页面怎么适配ios页面
1.viewport 简单粗暴的方式:<meta name="viewport" content="width=320,maximum-scale=1.3,user ...
- Unity小知识---第三人称中设置摄像机的简单跟随
第三人称中设置摄像机的简单跟随 private Transform player; private Vector3 offect; private float smooothing = 3f; //插 ...
- C语言数据结构-链式队列的实现-初始化、销毁、清空、长度、队列头元素、插入、删除、显示操作
1.数据结构-链式队列的实现-C语言 typedef struct QNode { int data; struct QNode *next; }QNode,*QueuePtr; typedef st ...
- P2925 [USACO08DEC]干草出售Hay For Sale 题解
\(\Huge{dp第一题}\) 题目描述 农民john面临一个很可怕的事实,因为防范失措他存储的所有稻草给澳大利亚蟑螂吃光了,他将面临没有稻草喂养奶牛的局面.在奶牛断粮之前,john拉着他的马车到农 ...
- UICollectionView 如何定制每个Cell的Size
最新用UICollectionView遇到挺多坑,差点让我废寝忘食了,虽然UICollectionView 逼格比UITableView高,但是真正想定制起来,特别是刚开始是用,真麻痹的到处都是坑,弄 ...