JavaScript 相关 —— 取当前日期
var myDate = new Date();
myDate.getYear(); //获取当前年份(2位)
myDate.getFullYear(); //获取完整的年份(4位,1970-????)
myDate.getMonth(); //获取当前月份(0-11,0代表1月)
myDate.getDate(); //获取当前日(1-31)
myDate.getDay(); //获取当前星期X(0-6,0代表星期天)
myDate.getTime(); //获取当前时间(从1970.1.1开始的毫秒数)
myDate.getHours(); //获取当前小时数(0-23)
myDate.getMinutes(); //获取当前分钟数(0-59)
myDate.getSeconds(); //获取当前秒数(0-59)
myDate.getMilliseconds(); //获取当前毫秒数(0-999)
myDate.toLocaleDateString(); //获取当前日期
myDate.toLocaleTimeString(); //获取当前时间
myDate.toLocaleString( ); //获取日期与时间
DateTime.Now.ToString("yyyy年MM月dd日 ddd",System.Globalization.CultureInfo.CreateSpecificCulture("zh-CN")) //获取当前的日期与星期; 格式:2009年07月09日 星期四
相关文档:
<html>
<body>
<script type="text/JScript">
for (i=0; i<10000; i++) { // this loop enforces the effect
var model = new Object();
var element = document.createElement("<br>");
model.myElement = ......
自定义控件中的页面代码:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="wcontrol.ascx.cs" Inherits="wcontrol" %>
<script type ="text/javascript">
function PopupCalendar(InstanceName)
{
///Global Tag
this.instanceName=InstanceName;
///Properties
this.separator="-"
t ......
1. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键
<table border oncontextmenu=return(false)><td>no</table> 可用于Table
2. <body onselectstart="return false"> 取消选取、防止复制
3. onpaste="return false" 不准粘贴
4. oncopy="return false;" oncut="return f ......
这几天,我在读《Javascript语言精粹》。
这本书很薄,100多页,正好假日里翻翻。
该书的作者是Douglas Crockford,他是目前世界上最精通Javascript的人之一,也是Json格式的创造者。
他认为Javascript有很多糟粕。因为1995年Brendan Eich设计这种语言的时候,只用了三个月,很多语言特性没有经过深思熟虑,就推向了市 ......
一、概述
考虑Html本身不带定时刷新页面的控件,且不考虑使用第三方控件;因此考虑使用Javascript中的setTimeout+xmlhttp来实现定时更新页面中部分内容,此实现在IE6.0及以上版本测试通过,其他浏览器暂时未测试过。
二、功能及特点
1、Javascript通过Microsoft的MSXML对象,动态获取后台数据库数据;
&n ......