1 dom获得select的值:var val=document.getElementById("sortby").options[document.getElementById("sortby").selectedIndex].value;
2 jquery获得select的各种值:http://blog.sina.com.cn/s/blog_76cd6de80100rs9m.html
3 jquery ajax:
js: jQuery.ajax({
url : 'new.ajx',
data : "email="+ email +"&vid="+ "$vendorSettingsDTO.vendorId"+"&randomKey="+new Date(),
type : 'get',
dataType: "json",
success : function(data) {
alert(data.__Message);
}
});
code: .. extends AbstractController{
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request,
HttpServletResponse response) throws Exception {
response.setCharacterEncoding("UTF-8");
Writer out = response.getWriter();
JSONObject jsObject = new JSONObject();
try {
String vendorId = request.getParameter("vid");
String email =request.getParameter("email");
String msg="success";
jsObject.put("__Success", "true");
jsObject.put("__Message", msg);
out.write(jsObject.toString());
} catch (Exception e) {
jsObject.put("__Success", "false");
jsObject.put("__Message", e.getMessage());
out.write(jsObject.toString());
}
return null;
}}
4 数字输入判断 :http://blog.163.com/mende_001/blog/static/611304352008810115037503/