爱玺玺

爱玺玺的生活日记本。wx:lb87626

jquery移除disabled属性

$("#province").removeAttr("disabled");

或者让disabled失效

$("#province").attr("disabled",false);


jquery的change()函数,对应js的onchange事件,很有用处

$("#country").change(function(){

   alert();

});


select设置option为不能被选中 disabled

<select id="country">

     <option selected="selected" disabled="disabled">请选择国家</option>   

</select>


jquery在select中增加option

<select id="country">

     <option></option>   

</select>

</body>

</html>

<

jquery通过ajax取出json数据,o[1].name_cn

<script>

$("#country").click(function(){

   $.post("liandong.php",{'p':0},function(data){

  var o=data;

php将数据库搜索的结果转成json使用函数json_encode(),encode编码的意思

$country=$db->getall("select Name_cn from t_country where ParentId=0");

//var_dump($country);

echo json_encode($country);


php获取数组长度使用count函数

count($country)

Struts配置和表单映射,关键配置

QQ图片20180207210153.gif

struts的html标签form提交路径需要加斜杠

 <html:form action="/users.do" method="post">

       name:<html:text property="name"></html:text>

    </html:for

再理解struts的web.xml文件调用了struts-config.xml文件

再理解struts的web.xml文件调用了struts-config.xml文件

因此form表单提交路径不需要在web.xml文件中配置。

Powered By Z-BlogPHP 1.4 Deeplue Build 150101

Copyright Your WebSite.Some Rights Reserved.

蜀ICP备11021721号-5