惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Vulnerabilities – Threatpost
U
Unit 42
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
F
Full Disclosure
月光博客
月光博客
Engineering at Meta
Engineering at Meta
博客园_首页
The Register - Security
The Register - Security
G
Google Developers Blog
The Cloudflare Blog
博客园 - Franky
K
Kaspersky official blog
A
Arctic Wolf
Scott Helme
Scott Helme
C
Cisco Blogs
Hugging Face - Blog
Hugging Face - Blog
C
Check Point Blog
NISL@THU
NISL@THU
AI
AI
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
Vercel News
Vercel News
T
Tor Project blog
P
Privacy International News Feed
D
Docker
I
Intezer
L
LangChain Blog
P
Proofpoint News Feed
Security Latest
Security Latest
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
博客园 - 聂微东
AWS News Blog
AWS News Blog
Martin Fowler
Martin Fowler
P
Privacy & Cybersecurity Law Blog
V
V2EX
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
The Hacker News
The Hacker News
T
Tenable Blog
Blog — PlanetScale
Blog — PlanetScale
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog

博客园 - 骑着夕阳看着猪

asp.net mvc 中hmtl.xxxx是否使用<%=... %> 高版本(vs2008)如何打开低版本解决方案和项目(vs2003、vs2005的项目) 序列化和反序列化 sql 根据父节点查找所有子节点 用jquery实现学校的校历 一步一步学jquery UI 1.72 之datepicker - 骑着夕阳看着猪 显示日期是当前区间第几周? - 骑着夕阳看着猪 - 博客园 c# 日期相减 如何使图片在div里上下居中 - 骑着夕阳看着猪 - 博客园 实现qq邮箱换肤(第二季 ) - 骑着夕阳看着猪 - 博客园 实现qq邮箱换肤(第一季 ) 获取元素和鼠标的位置(兼容IE6.0,IE7.0,IE8.0,FireFox2.0,FireFox3.5,Opera) img src='' 为空引发的问题 - 骑着夕阳看着猪 如何清除html图片缓存 - 骑着夕阳看着猪 - 博客园 关于 wcf揭秘 第四章代码运行错误 - 骑着夕阳看着猪 配置SQL Server2005以允许远程访问 SQL Server2005还原数据库详细 实现控件的随意拖动 BindingManagerBase的应用
初试ajax基础
骑着夕阳看着猪 · 2008-06-09 · via 博客园 - 骑着夕阳看着猪

这是我javascript第一课,javascript如何获取html页中控件,并设置或获取控件的值,以下是页面的源代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>

</head>

<body>
<script language="javascript">
    
function SetValue()
    
{
        
var myDom= document.getElementById("textbox1")
//        var myDom=document.all.textbox1;
//
        var myDom=document.all.form1.textbox1;
        myDom.value="123";
    }

</script>
<form id="form1">
<input id="textbox1" name="textbox" type="text" maxlength="50" onmousedown="SetValue()"  />
</form>
</body>
</html>

代码中注释的语句,也同样可以获取到“文本框”

第二课:如何使用setTimeout和setInterval,二者之间有什么区别?
先看setInterval("方法名","时间间隔"),该方法作用是:它从载入后,每隔指定的时间就执行一次表达式.
下面页面中函数的功能就是你将页面打开15秒后自动关闭,并将倒数计时写在页面上

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>

</head>

<body >
<script>
    
var i=0;
    
var count=16;
    
function GetDate()
    
{
        i
=i+1;
        
var myDiv = document.all.div1;
        myDiv.innerHTML
= count - i;
        
if((count-i)==0)
        
{
            window.close();
        }

        
    }

</script>
<div id="div1" ></div>
</body>
</html>


下面来看看setTimeout():在载入后延迟指定时间后,去执行一次表达式,仅执行一次

<script language="javascript">
var i;
i
=0;
function reloop()
{
i
=i+1;
alert(String(i));
setTimeout(
"reloop()",1000);
}

reloop();

初试javascript,希望能给大家一点小小帮助,同时热切期待高手的指点.....