javascript字符串转换成日期[js常用]
function strToDate(){
var nowDate = new Date();
var oldDate = '2009-06-08';
var oldTime = '16:00';
var year = oldDate.substr(0,4);
var month = oldDate.substr(5,2);
var day = oldDate.substr(8,2);
var temDate = month+'/'+day+'/'+year+' '+oldTime+":00";
alert(temDate);
//与当前时间比较
alert(new Date(Date.parse(temDate))>nowDate);
}
相关文档:
//设置当前页面为用户的首页
function setHomepage()
{
document.body.style.behavior='url(#default#homepage)';
document.body.setHomePage(window.location.href);
event.returnValue=false;
return;
}
//加入收藏
function addFavorite()
{
&nb ......
拼图游戏,在ie7 ,火狐,谷歌 测试通过。
HTML code
<!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 runat="server">
<title> ......
源码:
function resize(img, width, height) {
(img.width > img.height)
? ((img.height = Math.min(height, width * img.height/img.width)) || (img.width = Math.min(width, img.width)))
: ((img.width = Math.min(width, height * img.width/img.height)) || (img.height = Math.min(hei ......
随着浏览器安全性的提高,要实现图片预览也越来越困难。
不过群众的智慧是无限的,网上也有很多变通或先进的方法来实现。
在研究了各种预览方法后,作为总结,写了这个程序,跟大家一起分享。
上次写的简便无刷新文件上传系统最初的目的就是用来实现这个图片预览效果。
兼容:ie6/7/8, firefox 3.5.5
后台支持下还兼容 ......
表单名fm 表单中有两个text :name,no 一个radio:sex 一个checkbox:hobby 一个下拉列表框(日期:year month day)
一个textarea ……还有两个按钮 submit 和 reset
如何用JavaScript验证这些内容非空,要求点“提交”按钮的时候 提示非空, 具体html代码如下:
<html>
<he ......