javascript

微擎框架通过ajax省掉form标签

input框: <button class="btn btn-primary btn-sm" style="float: right;">扣量百分比</button><input id="comment" class="form-control" style="float: right; margin: 0 10px; width: auto; border: 1px solid #1ab394;" name="comment" type="text" placeholder="请输入扣量比,单位%" /> ajax: function add(){ var comment = document.getElementById("comment").value; // alert(comment); if(comment == ""){ alert("不可为空"); return ; } $.post('{php echo webUrl("goods/customPage/rfv ...

js获取页面所有的链接

function getAllRefs()
{
var reg0 = /href=".*?"/g;
var bodyContent = document.body.innerHTML;
var hrefs = bodyContent.match(reg0);
var str = hrefs.join("\n");
var reg1 = /href="(.*?)"/g;
var text = str.replace(reg1,"$1");
document.write(text);
}
getAllRefs();

将这一段代码加入到控制台,回车