小编Sim*_*ofi的帖子

Javascript函数如何运行

我想知道javascript函数如何加载或运行.

举个例子,我有这些javascripts功能块;

<span id=indicator></span>

function BlockOne(){
    var textToWrite = document.createTextNode("I am   ");
    document.getElementById("indicator").appendChild(textToWrite);
} 
//==========
function BlockTwo(){
    var textToWrite = document.createTextNode("Going   ");
    document.getElementById("indicator").appendChild(textToWrite);
} 
//=========
function BlockThree(){
    var textToWrite = document.createTextNode("To School   ");
    document.getElementById("indicator").appendChild(textToWrite);
} 

function RunAll(){
    BlockOne();
    BlockTwo();
    BlockThree();
}
window.onload=RunAll();
Run Code Online (Sandbox Code Playgroud)

请先运行这些功能块中的哪一个或以什么顺序运行.

javascript jquery

0
推荐指数
1
解决办法
69
查看次数

标签 统计

javascript ×1

jquery ×1