博客园  :: 首页  :: 新随笔  :: 订阅 订阅  :: 管理
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 32 下一页

2011年12月21日

摘要: 参考资料:http://www.cnblogs.com/jeffhsu/archive/2011/08/24/2152013.html看了jeffhsu的方法挺好的,但需要做一个Excel模版,参考网上资料改进了一下。//Asp.net 导出EXCELprivate void ExportExcel(){ //临时文件 string tempFile = string.Format("{0}/{1}.xls", System.Environment.GetEnvironmentVariable("TEMP"), Guid.NewGuid()); //使用 阅读全文

posted @ 2011-12-21 15:31 PHP-张工 阅读(901) 评论(1) 推荐(1)

2011年12月19日

摘要: 原理利用CSS特性 #msgBody div{},当有ID为msgBody存在时才生效来实现。兼容性兼容IE7+、Chrome、火狐IE6下Select元素总在最上层。并且不支持fix所以只能绝对定位。弹出层是会跳转到顶部。IE6下修改body的ID后display:block; 显示有问题(有一部分显示),在IE6下时,使用left:-10000px;来实现隐藏。JS中调用方法弹出方法:document.body.id = 'msgBody';隐藏方法:document.body.id = '';Chrome下测试效果实例下载:http://files.cnb 阅读全文

posted @ 2011-12-19 16:25 PHP-张工 阅读(8859) 评论(1) 推荐(2)

2011年12月12日

摘要: 测试的网页结构如下:<!DOCTYPE html><html><head> <title>标题</title></head><body onclick="alert(1);"><div>aaaaaaa</div></body></html>打开网页后,点击空白处并不会触发body的onclick事件。只有点击有文字的那一行才会触发。说明body没有充满网页。但奇怪的是IE、Chrome如上面所说。而火狐点击空白处会触发onclick事件。为了看 阅读全文

posted @ 2011-12-12 16:59 PHP-张工 阅读(1173) 评论(0) 推荐(2)

摘要: 使用连接执行JS的方法如下:使用href="javascript:alert(1);" 执行<a href="javascript:alert(1);">test</a>使用onclick="alert(1)" 执行<a href="#" onclick="alert(1);">test</a>事件绑定执行<a id="a1" href="#">test</a><script&g 阅读全文

posted @ 2011-12-12 16:31 PHP-张工 阅读(19478) 评论(0) 推荐(1)

摘要: <input />在浏览器中会解析成什么呢?经过测试会解析成文本输入框。使用JS获取type属性也是text。(IE、火狐、Chrome)但发现如果使用如下样式:input[type="text"]{color:red;}只在IE下有效。(未测试IE9) 阅读全文

posted @ 2011-12-12 16:05 PHP-张工 阅读(238) 评论(0) 推荐(0)

2011年12月8日

摘要: 只看本页的所有图片javascript:var h='',o=document.images,i=0;while(o[i]){h+=o[i++].outerHTML;}document.write(h);只看本页高度大于100的图片javascript:var h='',o=document.images,i=0;while(o[i]){if(o[i].offsetHeight>100)h+=o[i].outerHTML;i++;}document.write(h);只看内容长度大于100的内容 (屏蔽非必要内容)javascript:var o=docu 阅读全文

posted @ 2011-12-08 14:08 PHP-张工 阅读(363) 评论(0) 推荐(0)

2011年12月7日

摘要: 通常为了兼容多个浏览器,一般都要是用css hack。#test{ color:red; /* 所有浏览器都支持 */ color:red !important;/* Firefox、IE7支持 */ _color:red; /* IE6支持 */ *color:red; /* IE6、IE7支持 */ *+color:red; /* IE7支持 */ color:red\9; /* IE6、IE7、IE8支持 */ color:red\0; /* IE8支持 */}今天看 www.laiwang.com 时,发现他的HTML 的class属性中包含了如下信息。ua-webkit... 阅读全文

posted @ 2011-12-07 17:39 PHP-张工 阅读(1116) 评论(0) 推荐(1)

2011年11月30日

摘要: 不需要访问后台服务器端,不使用Ajax,无刷新,纯JS实现的省市区三级联动。当省市区数据变动是只需调正js即可。使用方法: 纯JS省市区联动 省:市:区:省:市:区:核心代码如下:var addressInit = function(_cmbProvince, _cmbCity, _cmbArea, defaultProvince, defaultCity, defaultArea){ var cmbProvince = document.getElementById(_cmbProvince); var cmbCity = document.getElementById(_cmbCity); 阅读全文

posted @ 2011-11-30 16:47 PHP-张工 阅读(97094) 评论(29) 推荐(6)

摘要: 在浏览器中访问:http://fw.qq.com/ipaddress就可看到你的外网IP 和所在省市返回内容为:var IPData = new Array("10.85.177.57","","陕西省","西安市");使用方法使用如下连接可获取指定IP的信息http://www.ip.cn/getip2.php?action=queryip&ip_url=1.85.177.57返回内容为:您查询的IP是:1.85.177.57来自:陕西省西安市 电信2013-08-20 更新:可以使用http://ip. 阅读全文

posted @ 2011-11-30 13:25 PHP-张工 阅读(4245) 评论(3) 推荐(0)

2011年11月29日

摘要: 效果:代码:<!DOCTYPE html><html><head> <title>TABLE 样式</title> <style type="text/css"> .tbData { border-collapse:collapse; border:solid 3px #ddd; font-family:Courier New, Tahoma, 宋体; font-size:14px; color:#333; background-color:white; border-spacing:0px; } .t 阅读全文

posted @ 2011-11-29 17:27 PHP-张工 阅读(1549) 评论(0) 推荐(0)

上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 32 下一页