The onload event occurs immediately after a page or an image is loaded.
onload事件当一个页面或是一张图片加载完成时被触发。
onload="所要执行的代码"
Parameter
参数
Description
注释
SomeJavaScriptCode
所要执行的代码
Required. Specifies a JavaScript to be executed when the event occurs.
必选项。当事件触发时所要执行的代码。

Supported by the following HTML tags:
所支持的HTML标签:

<body>, <frame>, <frameset>, <iframe>, <img>, <link>, <script>

Supported by the following JavaScript objects:
所支持的JavaScript对象:

image, layer, window

Example
实例

In this example the text "Page is loaded" will be displayed in the status bar:
在下面的例子中,页面加载完成时页面状态栏将出现“页面已加载”:

<html>
<head>
<script type="text/javascript">
function load()
{
window.status="页面已加载"
}
</script>
</head>
<body onload="load()">
</body>
</html>

JavaScript onload的更多相关文章

  1. jQuery $(document).ready()和JavaScript onload事件

    jQuery $(document).ready()和JavaScript onload事件 Why we need a right time? 对元素的操作和事件的绑定需要等待一个合适的时机,可以看 ...

  2. JQuery与JavaScript onload的区别

    1.window.onload 不能有多个,后面的功能会覆盖前面.而jQuery(document).ready()可以存在多个. 2.window.onload 在页面所有元素(包括图片,引用文件) ...

  3. javascript onload队列

    2014年10月29日 10:40:14 function addLoadEvent(func){ var oldonload = window.onload; if (typeof window.o ...

  4. javascript complete, onload

    1.complete 属性可返回浏览器是否已完成对图像的加载 <html> <head> <script type="text/javascript" ...

  5. 关于Javascript的内存泄漏问题的整理稿

    写了好长时间javascript小功能模块,从来没有关注过内存泄漏问题.记得以前写C++程序的时候,内存泄漏是个严重的问题,我想是时候关注一下了.网上找了篇文章,Mark一下.原文地址:http:// ...

  6. javascript写的ajax请求

    <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> &l ...

  7. javascript小数四舍五入

    javascript小数四舍五入 1. function get(){    var s = 22.127456 + "";    var str = s.substring(0, ...

  8. 【JavaScript】轻易改变的背景和字体颜色页面

    JavaScript,点击button改变页面背景和字体颜色,网页有N颜色的变化button.点击不同button,网页字体和背景将被改变为不同的颜色. 非常easy的JavaScript小程序. 一 ...

  9. 深入理解javascript异步编程障眼法&&h5 web worker实现多线程

    0.从一道题说起 var t = true; setTimeout(function(){ t = false; }, 1000); while(t){ } alert('end'); 1 2 3 4 ...

随机推荐

  1. Java编程基础-面向对象(上)

    一.面向对象的概念 1.概念:面向对象是把解决的问题按照一定规则划分为多个独立的对象,然后通过调用对象的方法来解决问题.当然,一个应用程序会包含多个对象,通过多个对象的相互配合来实现应用程序的功能.这 ...

  2. hihocoder1829 Tomb Raider

    思路: 暴力枚举. 实现: #include <iostream> #include <set> #include <vector> using namespace ...

  3. 安装MySQLdb出现HAVE_WCSCOLL重定义问题的解决方法

    root@wodeyitian MySQL-python-1.2.3]# python setup.py install running install running bdist_egg runni ...

  4. 异步 Thread

    Threads 最早的版本,微软推荐不要再使用Thread了thread不支持带返回值的方法本身也没有线程回调,但是可以自己做一个 private void btnThreads_Click(obje ...

  5. codevs 2919 选择题

    时间限制: 1 s  空间限制: 16000 KB  题目等级 : 黄金 Gold 题目描述 Description 某同学考试,在N*M的答题卡上写了A,B,C,D四种答案. 他做完了,又不能交,一 ...

  6. 利用python进行数据分析2_数据采集与操作

    txt_filename = './files/python_baidu.txt' # 打开文件 file_obj = open(txt_filename, 'r', encoding='utf-8' ...

  7. java解析sql文件

    package com.athena.ckx.util; import java.io.FileInputStream; import java.io.InputStream; import java ...

  8. 自己开发一个APP需要多少钱

    广州APP开发公司[启汇网络]经常遇到有开发定制APP软件需求的企业,通常第一句问的就是“开发一款APP需要多少钱”,在做完客户行业的市场调查后,再了解客... 广州APP开发公司[启汇网络]经常遇到 ...

  9. 830. Positions of Large Groups@python

    In a string S of lowercase letters, these letters form consecutive groups of the same character. For ...

  10. 【最长连续零 线段树】bzoj1593: [Usaco2008 Feb]Hotel 旅馆

    最长连续零的线段树解法 Description 奶牛们最近的旅游计划,是到苏必利尔湖畔,享受那里的湖光山色,以及明媚的阳光.作为整个旅游的策划者和负 责人,贝茜选择在湖边的一家著名的旅馆住宿.这个巨大 ...