易截截图软件、单文件、免安装、纯绿色、仅160KB

javascript 把字符转换为json2


<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">   
    <title>数据列表Grid的应用</title>
 <link rel="stylesheet" type="text/css" href="scripts/ext/resources/css/ext-all.css" />
 <script type="text/javascript" src="scripts/ext/adapter/ext/ext-base.js"></script>
 <script type="text/javascript" src="scripts/ext/ext-all.js"></script>
 <!--  <script type="text/javascript" src="user/grid-simple.js"></script>-->
    <script type="text/javascript">
     Ext.onReady(function(){
   var cm = new Ext.grid.ColumnModel([{
    header : 'id',
    dataIndex :'id' 
   },{
    header : 'name',
    width : 145,
    dataIndex : 'name'
   },{
    header : 'email',
    width : 150,
    dataIndex : 'email'
   },{
    header : '性别',
    dataIndex:'sex'
   },{
    header : '年龄',
    dataIndex : 'age'
   }]);
  var fields=["id","name","email","sex","age"];
  var str="[{'id':'1','name':'langsin1','email':'langsin@langsin.com','sex':'0','age':'20'},"
     +"{'id':'2','name':'ff','email':'ff@langsin.com','sex':'1','age':'30'}]";
  var json = eval("(" + str + ")");
 


相关文档:

javascript感言

                                                    ......

c# cookie的使用,以及与javascript cookie的交互

C#:
创建:
    HttpCookie cookie = new HttpCookie("regID");
            cookie .Value = username;
            cookie .Expires = DateTime.Now.AddDays(1);
  & ......

JavaScript 基础技巧(2)

14 分割字符串
1: <script language=”JavaScript”>
2: <!--
3: var myVariable = “a,b,c,d”;
4: var stringArray = myVariable.split(“,”);
5: document.write(stringArray[0]);
6: document.write(stringArra ......

javaScript 常用技巧(一)


事件源对象 
event.srcElement.tagName 
event.srcElement.type
捕获释放 
event.srcElement.setCapture();  
event.srcElement.releaseCapture();  
事件按键 
event.keyCode 
event.shiftKey 
event.altKey 
event.ctrlKey
事件返回值 
event ......

JavaScript CSS Style属性对照表


JavaScript CSS Style属性对照表
文章来源:http://www.phplamp.org/2008/10/jsavscript-js-css-style/
为了达到某种特殊的效果我们需要用Javascript动态的去更改某一个标签的Css属性。比如:鼠标经过一个图片时我们让图片加一个边框,代码可能是这样:
JavaScript代码
<script type="text/javascript"> & ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号