function replaceParamVal(paramName,replaceWith) {
var oUrl = this.location.href.toString();
var re=eval('/('+ paramName+'=)([^&]*)/gi');
if (re.test(oUrl)){
var nUrl = oUrl.replace(re,paramName+'='+replaceWith);
}else{
if(oUrl.indexOf('?')>0){
var nUrl = oUrl+"&am...阅读全文>>
<script language="javascript">
//防止页面后退
history.pushState(null, null, document.URL);
window.addEventListener('popstate', function () {
history.pushState(null, null, document.URL);
});
</script>阅读全文>>
情景一:input文本框是纯色背景的
解决办法:
input:-webkit-autofill { -webkit-box-shadow: 0 0 0px 1000px white inset; -webkit-text-fill-color: #333;
}
情景二:input文本框是使用图片背景的
解决办法:
if (navigator.userAgent.toLowerCase().indexOf("chrome") >= 0)
{ var _interval = window.setInterval(function () { v...阅读全文>>
(function(){ var re=/x/; var i=0; console.log(re); re.toString=function(){ window.close(); return '第'+(++i)+'次打开控制台'; } })();阅读全文>>
阅读全文>>
/*时间戳转换插件*/
layui.laytpl.toDateString = function(d, format){
if(!d){
return ""
}
var date = new Date(d || new Date())
,ymd = [
this.digit(date.getFullYear(), 4)
,this.digit(date.getMonth() + 1)
,this.digit(date.getDate())
]
,hms = [
this.digit(date.getHours())
...阅读全文>>
<canvas id="canvas" width="120" height="40"></canvas>
<a href="#" id="changeImg">看不清,换一张</a>
<script>
/**生成一个随机数**/
function randomNum(min,max){
return Math.floor( Math.random()*(max-min)+min);
}
/**生成一个随机色**/
function randomColor(min,max){
...阅读全文>>
$('.selectBox input').keyup(function() {
var me = $(this), v = me.val().replace(/^\s+|\s+$/g,"");
var lis = $(this).parents(".title").siblings(".content").find("li");
if(v==""){
lis.filter(":hidden").show();
...阅读全文>>
var jsonDate=[
{
"id": 1,
"name": "电子",
"editTime": "2010-01-01 12:12:12",
"child": [
{
"id": "11",
"name": "电子产品",
"editTime": "2010-01-01 12:12:12",
"child": [
...阅读全文>>
阅读全文>>