javascript读取xml实现应用程序菜单效果
/*样式*/
<style type="text/css">
td{font-size:12px;}
.item{text-decoration:none;width:100%;height:100%; line-height:22px;cursor:default;color:Black;vertical-align:middle}
.staticTab{cursor:default;height:22px}
.staticTD{width:70px;text-align:center; vertical-align:middle;white-space:nowrap}
.dynamicTR{height:22px; vertical-align:middle}
.dynamicTab{width:60px;cursor:default;background-color:#ccebff;position:absolute;z-index:1}
.dynamicTDRight{text-align:right;font-size:9px;}
.dynamicTDCenter{text-align:left;white-space:nowrap}
</style>
/*--------------菜单应用到的js--------------------*/
var menuHTML="";
function createXMLHttpRequest(){xmlHttp=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();}
function getMenuData(){//从后太获取头部的单据或审批人等的信息
createXMLHttpRequest();
xmlHttp.open("GET","Menu.ashx?id="+(new Date()).getTime(),true);
xmlHttp.onreadystatechange=getMenu_onreadystatechange;//用函数名,不加括号.
xmlHttp.send(null);
}
function getMenu_onreadystatechange(){//相应处理
if(xmlHttp.readyState==4){
if(xmlHttp.status==200){
var menuXML=xmlHttp.responseXML.getElementsByTagName("menu");//childNodes
createStaticMenu(menuXML[0]);
}else
alert('服务器端发生错误!');
}
}
function getId(number,fatherId){
number+=1;
if(number<1
相关文档:
var myDate = new Date();
myDate.getYear(); //获取当前年份(2位)
myDate.getFullYear(); //获取完整的年份(4位,1970-????)
myDate.getMonth(); //获取当前月份(0-11,0代表1 ......
需求:模拟表单提交并可设置提交间隔
还好页面是ajax提交的,只要写个js定时提交就ok了。 于是找了几个写的类似于sleep的功能,拿过来用用发现也不是很好用。
自已写了个
<script language="javascript">
var base = {};
......
base.auto_submit = function(){
var total = 10 ......
号称xmlhelper的一个类
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;
namespace WebApplication2
{
/// <summary>
/// XMLHelper XML文档操作管理器
/// </summary>
public class XMLHelper
{
public X ......
Procedure TForm1.Button1Click(Sender: TObject);
Var
xmlstr,FileName: String;
f: Textfile;
Begin
xmlStr := '<?xml version="1.0" encoding="gb2312"?>';
xmlstr := xmlstr + '<user><name>张三</name><sex>男</sex></user>';
sh ......
JavaScript的window对象的open方法的语法格式如下:
window.open("页面的URL","窗口名称","窗口参数");
页面的URL:页面的URL可以是相对路径,也可以是绝对路径。
窗口名称:弹出窗口的名称可以自行定义,它的意义在于,当你刷新原始的这页全窗口的时候,弹出窗口就会刷新一次;而如果把名称省略,改为"",那么当刷新这 ......