`
jickcai
  • 浏览: 239346 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
javascript学习笔记: 2009-09-18: -------------------- 第二章 ECMAScript 基础 原始类型 ECMAScript有5种原始类型: Undefined,Null,Boolean,Number,String typeof运算符 typeof运算符有一个参数,即要检查的变量或值。 var sTemp="test string"; alert(typeof sTemp); //output "string" 类型有: undefined,boolean,number,string,object ...

php 生成xml

    博客分类:
  • php
设置header('Content-type: text/xml'); 可以把php当成xml来访问。 <?php header('Content-type: text/xml'); echo '<?xml version="1.0" encoding="utf-8"?> <root> <data>,3月1日,3月2日,3月3日,3月4日,3月5日,3月6日,3月7日,3月8日,3月9日,3月10日,3月11日,3月12日 风速,5728,5493,5723,6464,6775,6821,6730, ...
HttpClient 是 Apache Jakarta Common 下的子项目,可以用来提供高效的、最新的、功能丰富的支持 HTTP 协议的客户端编程工具包,并且它支持 HTTP 协议最新的版本和建议。 HttpClient下载地址:http://hc.apache.org/downloads.cgi 示例是api中的一个examples: package org.apache.http.examples; import java.net.Socket; import org.apache.http.ConnectionReuseStrategy; import org.apache.ht ...
2009-09-01 目录和文件操作: cd cd.. 上移一层目录 cd../.. 下移两层 ls ls -l 列出所有 ls -a 列出所有包含隐藏文件 touch touch cai.txt 创建空白文件cai.txt cp cp fiel1 file2 把file1内容复制到file2中 cp file* Dir1 将多个文件复制到一个目录 cp -f file1 file2 如果文件file2 已经存在,则这个命令覆盖其内容时不发出提示 cp -i file1 file2 如果文件file2已经存在,则覆盖内容时先发出提示 cp -p ...
类似:http://ent.qq.com/a/20090819/000004.htm的效果,使用javascript实现。

cookie

/**********取得cookie*******/ function getCookie(key) { cookies = document.cookie; if (cookies) { var start = cookies.indexOf(key + '='); if (start == -1) { return ''; } var end = cookies.indexOf(";", start); if (end == -1) { end = cookies.length; } end -= start; var cookie = co ...
在 tomcat/conf/web.xml 里面增加如下的部分(里面有好多的这种映射) <mime-mapping> <extension>rar</extension>  <mime-type>application/x-tar</mime-type>  </mime-mapping>
window.showModalDialog("header.html",window,'dialogwidth:600px;dialogheight:500px;help=no;status=no;center=yes;edge=sunken;resizable=yes;Minimize=yes;Maximize=yes');
wtp 在线安装地址: http://download.eclipse.org/webtools/updates/
打印: window.print() 关闭窗口不显示浏览器提示:window.opener=null;window.close(); document.execCommand()的作用(IE中) <input type=button value=剪切 onclick=document.execCommand('Cut')> <input type=button value=拷贝 onclick=document.execCommand('Copy')> <input type=button value=粘贴 onclick=document.execCommand ...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>动态加载js</title> <link href=&quo ...
<script> function formatNumber(number){ //把数字 12345678910,格式化成 12,345,678,910格式         if(/[^0-9]/.test(number)) return "不是数字"; //如果不是数字,提示不是数字         number=number.replace(/^(\d*)$/,"$1\,");  //和 number=number+"\,";等价:12345678910,         var re=/(\d)(\d{3}\,)/ ...
<script> //定义一个函数func1,具有属性p和方法A function func1(){       this.p="func1-";       this.A=function(arg){             alert(this.p+arg);       } } //定义一个函数func2,具有属性p和方法B function func2(){       this.p="func2-";       this.B=function(arg){              alert(this.p+arg);       } ...

php得到用户IP

    博客分类:
  • php
<?php $ip=""; if(isset($_SERVER['HTTP_CLIENT_IP'])){ $ip=$_SERVER['HTTP_CLIENT_IP']; }else if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])){ $ip=$_SERVER['HTTP_X_FORWARDED_FOR']; }else{ $ip=$_SERVER['REMOTE_ADDR']; } echo "ip=".$ip; ?>
mysql时间戳: 插入时间戳: INSERT INTO comment(CreateDate,content)values(UNIX_TIMESTAMP(),'content') 取到时间戳: SELECT content FROM_UNIXTIME(CreateDate,'%Y-%m-%d %H:%i:%s') as CreateDate FROM comment %Y-%m-%d %H:%i:%s 表示:2008-12-25 18:23:33 UNIX_TIMESTAMP()和FROM_UNIXTIME(CreateDate,'%Y-%m-%d %H:%i:%s')配对
Global site tag (gtag.js) - Google Analytics