jsp页面ajax同步加载select标签内容
<li> <select id="p_select" name="p_select" onchange=""> </select> </li> <script> var data=$.ajax({url:"/theme/shop/warehouse.jsp", async:false}); $("#p_select").html(""); $("#p_select").html(data.responseText); </script>
warehouse.jsp
<%@ page language="java" import="java.util.*,com.renesola.framework.obj.*,com.renesola.framework.db.*,com.renesola.framework.util.*,com.renesola.web.obj.*,com.renesola.web.dao.*,com.renesola.web.util.*,com.renesola.shop.obj.*,com.renesola.shop.dao.*,com.renesola.shop.util.*" pageEncoding="UTF-8"%> <% long country_id =StringUtil.getParam(request, "country_id", 1); long importwarehouseid =StringUtil.getParam(request, "importwarehouseid", 0); List<IObj> warehouseList = WarehouseSQL.getInstance().doQueryByCountryId(country_id); if (!StringUtil.isEmpty(warehouseList)) { for (int i = 0; i < warehouseList.size(); i++) { WarehouseObj obj = (WarehouseObj) warehouseList.get(i); if(obj != null){ %> <option value="<%=obj.getId() %>" <%if(obj.getId()==importwarehouseid){ %>selected="selected"<%} %>><%=obj.getName() %></option> <% } } }else{ %> <option value="">have no warehouse</option> <% } %>
相关推荐
李永毅 2020-06-21
专注前端开发 2020-10-21
苏康申 2020-11-13
vitasfly 2020-11-12
oraclemch 2020-11-06
liuyang000 2020-09-25
FellowYourHeart 2020-10-05
赵继业 2020-08-17
whyname 2020-08-16
Seandba 2020-08-16
dbasunny 2020-08-16
拼命工作好好玩 2020-08-15
langyue 2020-08-15
写程序的赵童鞋 2020-08-03
Accpcjg 2020-08-02
tydldd 2020-07-30
好记忆也需烂 2020-07-28