js 바 인 딩 데이터

3222 단어 js
 <div>
                            <select id="s_province" name="s_province" errmsg="    "></select>&nbsp;&nbsp;
                            <select id="s_city" name="s_city" errmsg="    "></select>&nbsp;&nbsp;
                            <select id="s_county" name="s_county" errmsg="    "></select><br/>
                            <hr style="border-top:0px;border-left:none;border-right:none;border-bottom:none;"/>
                            <script type="text/javascript" src="${pageContext.request.contextPath}/style/js/area.js"></script>
                            <script type="text/javascript">_init_area();</script>                         
                          <input type="text" name="alladd" id="alladd" value="${wxWeixiuyuan.wxAddress.wxAddressDetailed}"  placeholder="    ..."style="width:355px;"/>
                        </div>
                        <div id="show"></div>
                    </div>

 
                                    var addressProvince = '';
                                    var addressCity = '';
                                    var addressDistrict = '';
                                    <c:if test="${wxWeixiuyuan.wxAddress!=null}">
                                    addressProvince="${wxWeixiuyuan.wxAddress.wxAddressProvince}"   ;
                                    addressCity="${wxWeixiuyuan.wxAddress.wxAddressCity}" ;
                                    addressDistrict="${wxWeixiuyuan.wxAddress.wxAddressDistrict}"   ;
                                   </c:if>
                                	
                                	selectAddressOption($("#s_province"), addressProvince);
                                	selectAddressOption($("#s_city"), addressCity);
                                	selectAddressOption($("#s_county"), addressDistrict);
                                	
                                	function selectAddressOption(selectObject, selectName) {
                                		$(selectObject).find('option').each(function(i){
                                    		var isFind = false;
                                    		if (isFind) return;
                                    		if ($(this).text() == selectName) {
                                    			isFind = true;
                                    			$(this).attr('selected', true);
                                    			$(selectObject).change();
                                    			return;
                                    		}
                                    	});
                                	}

좋은 웹페이지 즐겨찾기