123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- var XMLHttpReq;
- var currentSort;
- // ����XMLHttpRequest����
- function createXMLHttpRequest() {
- if (window.XMLHttpRequest) {
- XMLHttpReq = new XMLHttpRequest();
- } else if (window.ActiveXObject) {
- try {
- XMLHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
- } catch (e) {
- try {
- XMLHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
- } catch (e) {
- }
- }
- }
- }
- // ����������
- function sendRequest(url) {
- createXMLHttpRequest();
- XMLHttpReq.open("GET", url, true);
- XMLHttpReq.onreadystatechange = processResponse;
- XMLHttpReq.send(null);
- }
- // ���?����Ϣ����
- function processResponse() {
- if (XMLHttpReq.readyState == 4) {
- if (XMLHttpReq.status == 200) {
- updateMenu();
- } else {
- alert("���������ҳ�����쳣��");
- }
- }
- }
- /**
- * @gettype :all ���б����ֶ� constant ֻȡ�����ֶ� date ֻȡ���������ֶ� text
- * ������ͨ�����ı���¼����ֶ�
- */
- function getTable(obj, selectName, gettype) {
- if (obj.value == "")
- return;
- var strA = "";
- createXMLHttpRequest();
- axo = new ActiveXObject("Microsoft.XMLDOM");
- XMLHttpReq.open("POST", "getAttributeXml.jsp?classid=" + obj.getValue()
- + "&gettype=" + gettype, false);
- XMLHttpReq.setRequestHeader("Content-Length", strA.length);
- XMLHttpReq.setRequestHeader("Content-type",
- "application/x-www-form-urlencoded");
- XMLHttpReq.send(strA);
- axo.loadXML(XMLHttpReq.responseText);
- n1 = axo.selectNodes("/root/name");
- n2 = axo.selectNodes("/root/description");
- BuildSel(unescape(XMLHttpReq.responseText), selectName, n1, n2);
- }
- function BuildSel(str, sel, id, name) {
- sel.options.length = 0;
- if (id.length == 0) {
- sel.options[sel.options.length] = new Option('')
- return;
- }
- var arrstr = new Array();
- arrstr = str.split(",");
- sel.options[sel.options.length] = new Option('-��ѡ��-');
- // ��ʼ�����µ�Select.
- for (var i = 0; i < id.length; i++) {
- sel.options[sel.options.length] = new Option(name(i).text, id(i).text);
- }
- }
|