function stripscript(s)
{
var pattern = new RegExp(“[%–`~!@#$^&*()=|{}’:;’,\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“’。,、?]”) //格式 RegExp(“[在中间定义特殊过滤字符]”)
var rs = “”;
for (var i = 0; i < s.length; i++) {
rs = rs+s.substr(i, 1).replace(pattern, ”);
}
return rs;
}
月度归档: 2021年4月
layui 触发form select 点击
$("#yongtu").siblings("div.layui-form-select").find('dl dd[lay-value={$fangyuan["yongtu"]}]')
<div class="layui-input-block">
<select id="yongtu" name="yongtu" lay-filter="yongtu" lay-verify="required">
<foreach name="yongtu" item="pz">
<option value="{$pz.lxid}" <if condition='$fangyuan["yongtu"] eq $pz["lxid"]'>selected=""</if>>{$pz.lxming}</option>
</foreach>
</select>
</div>
tp6 where whereOR关联使用
Db::name($this->table)->alias($alias)
->where($condition)
->where(function ($query) use ($condition_or) {
$query->whereOr($condition_or);
})
->order($order);
遇到whereOr和where组合链式操作会把or条件和and条件并列处理
使用闭包放在where里就可以加上类似 and ( xxx or xxx)的条件了
layui input带单位
<span class="form-control-unit">万元</span>
.form-control-unit {
position: absolute;
top: 0;
right: 0;
z-index: 2;
display: block;
width: 34px;
height: 34px;
line-height: 34px;
text-align: center;
pointer-events: none;
}
可被百度抓取
之前设置的一直是禁止百度抓取,后台也忘记在哪里配置了。
现在打开options表的blog_public就可以了
记录一下 以后关闭的时候直接改参数
layui 操作兄弟ifram
首先 在父页面创建一个div id = detail_page_data, 在ifram1 调用parent.layer_open的时候保存 ifram1的index
然后在ifram2里可以获取ifram1的index从而通过parent 拿到ifram1的contentWindow.document
然后就可以操作ifram1里的信息了
1 2 3 4 | var relation_layer_index = parent.$( '#detail_page_data' ).data( 'relation_layer_index' ); var relation_ifram = parent.$( '#layui-layer-iframe' +relation_layer_index); $doc = relation_ifram[0].contentWindow.document; $($doc).find( "#bargain_uid" ).val() |