1.在特定范围里获得一个随机数var x = Math.floor(Math.random() * (max - min + 1)) + min;2.让页面自动刷新一次window.onload = function() { if (location.href.indexOf('#reload...
分类:
编程语言 时间:
2015-01-25 18:03:40
阅读次数:
159
我们常用的在a标签中有点击事件:1. a href="javascript:js_method();"这是我们平台上常用的方法,但是这种方法在传递this等参数的时候很容易出问题,而且javascript:协议作为a的href属性的时候不仅会导致不必要的触发window.onbeforeunload...
分类:
Web程序 时间:
2015-01-23 16:16:05
阅读次数:
122
Easyui 生成layoutvar $tabs;var $body;var $south;function appendLayout(title, href) { if (!$body) $body = $(document.body); if (!$body.hasCl...
分类:
其他好文 时间:
2015-01-23 13:14:03
阅读次数:
277
a href="#"> 点击链接后,页面会向上滚到页首,# 默认锚点为 #TOP 点击链接后,页面不动,只打开链接 作用同上,不同浏览器会有差异。点击链接后,不想使页面滚到页首,就用href="javascript:void(0)",不要用href="#",return false也有类似作用详解h...
分类:
编程语言 时间:
2015-01-22 17:12:59
阅读次数:
182
index.jspfunctiongetCSVData(){//tablesorter就是要导出的tablevarcsv_value=$(‘#tablesorter‘).table2CSV({delivery:‘value‘});//$("#download_schedule").attr("href","./download_schedule.jsp?csv_value=‘"+csv_value+"‘");$("#csv_text").val(csv_value);}<formaction..
分类:
Web程序 时间:
2015-01-22 15:55:27
阅读次数:
831
js:
返回并刷新
alert("恭喜您,操作成功!"); window.location.href=document.referrer;
返回不刷新
alert("恭喜您,操作成功!"); window.history.back(-1);
php
返回并刷新
javascript:window.location.href=document.referr...
分类:
编程语言 时间:
2015-01-22 15:36:54
阅读次数:
187
用于浮窗跳转至父窗口parent.document.location.href='parent.document.location.href = '/xxx/xxx.htm';取父窗口的元素 window.parent.$('#xxx');正常跳转window.location.href = '/x...
分类:
Web程序 时间:
2015-01-21 22:18:41
阅读次数:
170
1.使用windows.loaction.href链接下载: 此种下载在本页打开,eg:windows.location.href = http://www.xxx.xx/aa.apk;2.使用windows.open下载:此种下载在新页面打开,eg:windows.open(“http://www...
分类:
Web程序 时间:
2015-01-21 19:59:38
阅读次数:
139
注意:1.iframepage为框架名称 2.要用src不要用hrefsrc与 href区别src是search的简写,意思搜索对象.通过是放在图片或框架的时候用到这个它的作用,让网页去搜索这个对象(有可以是图片或网页等)并显示出来.href是hyperrefresh的缩写.意思是更新,刷新的意思....
分类:
其他好文 时间:
2015-01-21 19:47:22
阅读次数:
160
*.location.href 使用方法: top.location.href=”url” 在顶层页面打开url(跳出框架) self.location.href=”url” 仅在本页面打开url地址 parent.location.href=”url” 在父窗体打开Url地址 this...
分类:
Web程序 时间:
2015-01-20 20:14:00
阅读次数:
133