<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
var strArr=['请选择一本图书','疯狂Java讲义','疯狂Ajax讲义','疯狂XML讲义'];
var strArr1=[{name:'疯狂Java讲义'},{name:'疯狂Ajax讲义',name:'疯狂XML讲义'}];
var strArr2=[{book:'疯狂Java讲义',price:'99'},{book:'疯狂Ajax讲义',price:'79'},{book:'疯狂XML讲义',price:'69'}];
var strArr3={name:"疯狂Java讲义",price:"99",publish:"电子工业出版社"};
var objMap={first:{book:'疯狂Java讲义',price:'99'},
second:{book:'疯狂Ajax讲义',price:'79'},
third:{book:'疯狂XML讲义',price:'69'},
fourth:{book:'轻量级Java EE企业应用实战',price:'89'},
fifth:{book:'经典Java EE企业应用实战',price:'89'}
};
function add(){
dwr.util.addOptions("test",strArr);
}
function del(){
dwr.util.removeAllOptions("test");
}
function add1(){
dwr.util.addOptions("test1",strArr1,'name');
}
function del1(){
dwr.util.removeAllOptions("test1");
}
function add2(){
dwr.util.addOptions("test2",strArr2,'book','price');
}
function del2(){
dwr.util.removeAllOptions("test2");
}
function add3(){
dwr.util.addOptions("test3",strArr3);
}
function del3(){
dwr.util.removeAllOptions("test3");
}
function add4(){
dwr.util.addOptions("test4",objMap,'price','book');
}
function del4(){
dwr.util.removeAllOptions("test4");
}
function init(){
dwr.util.useLoadingMessage("123");
}
使用对象添加选项:
使用对象添加选项: