asdasdsd
<script>
正则 截取 function getUrlParam(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //һĿʽ var r = window.location.search.substr(1).match(reg); //ƥĿ if (r != null) return unescape(r[2]); return null; //زֵ }
截取上次点击的get传输的条件
var style_anli = getUrlParam('style_anli'); var model_anli = getUrlParam('model_anli'); var package = getUrlParam('package'); $(document).ready(function(){ $("#style_anli"+style_anli).addClass("s"); $("#model_anli"+model_anli).addClass("s"); $("#package"+package).addClass("s"); $("#style_anli").val(style_anli); $("#model_anli").val(model_anli); $("#package").val(model_anli); }); 赋值提交 function setProps(objid,value){ $("#"+objid).val(value); $("#qRooms").submit(); } 隐藏的提交表单</script> <form action="/index.php" id="qRooms" method="get"> <input type="hidden" name="m" value="content" id="m"/> <input type="hidden" name="c" value="index" id="c"/> <input type="hidden" name="a" value="lists" id="a"/> <input type="hidden" name="catid" value="{$catid}" id="catid"/> <input type="hidden" name="style_anli" value="" id="style_anli"/> <input type="hidden" name="model_anli" value="" id="model_anli"/> <input type="hidden" name="package" value="" id="package"/> </form>
<ul class="casStyle">
<li><a href="javascript:setProps('style_anli',0);" id="style_anli0">现代简约</a></li> !! setProps('style_anli',0) 赋值提交
<li><a href="javascript:setProps('style_anli',1);" id="style_anli1">乡村田园</a></li>
<li><a href="javascript:setProps('style_anli',2);" id="style_anli2">地中海</a></li>
</ul>
<?php if($_GET['style_anli']!=""){ $style_anli=" and style_anli=".$_GET['style_anli']; } if($_GET['model_anli']!=""){ $model_anli=" and model_anli=".$_GET['model_anli']; } if($_GET['package']!=""){ $package=" and package=".$_GET['package']; } $sql="catid=10 ".$style_anli.$model_anli.$package; $fengge=array('现代简约','乡村田园','地中海','混搭','欧式','中式','北欧','日式'); ?> {pc:content action="lists" catid="$catid" where="$sql" num="1" order="listorder DESC" page="$page" moreinfo="1" } !调取条件where=“”! {loop $data $r}