站点静态文件放到了另外一个域名下(方便cdn)
站点的域名为 www.phpec.org,而静态文件的域名为 static.phpec.org。
现在问题来了,
页面中加载css文件:<link rel="stylesheet" href="http://static.phpec.org/css/font.css" />
此css中调用了外部字体如下:
@font-face { f...
站点静态文件放到了另外一个域名下(方便cdn)
站点的域名为 www.phpec.org,而静态文件的域名为 static.phpec.org。
现在问题来了,
页面中加载css文件:<link rel="stylesheet" href="http://static.phpec.org/css/font.css" />
此css中调用了外部字体如下:
@font-face { f...
ie下面,会出现window.close()的时候出现询问窗口,消除它的方法为:
ie6及以下
window.opener = null;
window.close();
ie7及以上
window.opener = null;
window.open("","_self");
window.close();
其他浏览器支持 window.opener.dom_id.src的写法,但是ie不支持,解决的办...
|
|
自从HTML5能为我们的新网页带来更高效洁净的代码而得到更多的关注,然而唯一能让IE识别那些新元素(如<article>)的途径是使用HTML5 shiv,感谢remy sharp为我们提供了这个迷你脚本来解决IE支持HTML5的问题。
使用和下载
html5.js必须在页面head元素内调用(因为IE必须在元素解析前知道这个元素,所以这个js文件不能在页面底部调用。)
一个程序,在火狐、谷歌下面是正常的,但是在IE下面提示参数无效,经过分析,发现是action里面为空了。
一般来说,我们做表单提交,只要是post,而且是提交到当前页面的话,都是可以忽略action里面的内容的,看来validform没有对为空做处理,改action为完整的地址,就正常了。
思路,js操作滚动条进行偏移,然后判断是否有偏移
1 | $( "#test1" ).scrollTop(10); //操作滚动条 |
2 | $( "#test1Result" ).html($( "#test1" ).scrollTop() > 0 ? "有滚动条!" : "没有滚动条!" ); //判断是否有滚动 |
3 | $( "#test1" ).scrollTop(0); //滚动条返回顶部 |
...
先看一下Discuz!中的js代码
1 | function Html5notification() { |
2 | var h5n = new Object(); |
3 |
4 | h5n.issupport = function () { |
5 | var is = !!window.webkitNotifications; |
6 | if (is) { |
7 | if (window.webkitNotifications.check... |
1.eval方法
1 | function strToJson(str){ |
2 | var json = eval( '(' + str + ')' ); |
3 | return json; |
4 | } |
2.new Function方法
1 | function strToJson(str){ |
2 | var json = ( new Function( "return " + str))(); |
3 | return json; |
4 | ... |
在MySQL下运行完下面这个建表语句后。 如何从数据字典中,检索出这个表的字段的相关信息?
DROP TABLE IF EXISTS test_table;
CREATE TABLE test_table(
Test_ID int NOT NULL AUTO_INCREMENT PRIMARY &nb...
xml转array
字串
$xml = simplexml_load_string($data);
$array = json_decode(json_encode($xml),TRUE);
文件
$xml = simplexml_load_file($data);
$array= json_decode(json_encode($xml),TRUE);
或者
$array = (array) sim...
PHP5.3.27 的扩展php_opcache.dll
测试平台:Windows 2008 R2 x64 (IIS7.5 FastCGI,Apache2.2.23,Apache2.4.3, Nginx 1.2.9)
包含 Non Thread Safe 和 Thread Safe
如果用的是 FastCGI 请使用 Non Thread Safe 版
php_opcache.dll 的使用方法
php.i...