Duxcms Doccms 热门关键词代码示例

Duxcms Doccms 热门关键词代码示例

Duxcms:

<a href="javascript:;" onclick="javascript:post('{url('Article/Search/index')}', {id:1,keyword:'领导力培训'})">领导力培训</a>
<script type="text/javascript">
function post(url, params) {
var temp = document.createElement("form");
temp.action = url;
temp.method = "post";
temp.style.display = "none";
for (var x in params) {
var opt = document.createElement("textarea");
opt.name = x;
opt.value = params[x];
temp.appendChild(opt);
}
document.body.appendChild(temp);
temp.submit();
return temp;
}
</script>

Doccms:

<a href="javascript:;" onclick="javascript:post('/search/', {id:1,keyword:'<?php echo $data['title']; ?>'})"><?php echo $data['title']; ?></a>
<script type="text/javascript">
function post(url, params) {
var temp = document.createElement("form");
temp.action = url;
temp.method = "post";
temp.style.display = "none";
for (var x in params) {
var opt = document.createElement("textarea");
opt.name = x;
opt.value = params[x];
temp.appendChild(opt);
}
document.body.appendChild(temp);
temp.submit();
return temp;
}
</script>

a标签里的关键词自行替换为对应标签,修改对应提交地址即可,JS是一样的。

关键词: 热门关键词代码
2016-03-14 13:41:00 来源:本站 浏览:1605
关闭