鼠标经过链接的时候,总提示JS 1行、第xx个字符,错误信息是:“尚未实现 ”。从js入手调试了半天,解决不了问题。想到是不是css里的expression引起的,把链入的样式去掉,果真是。css的expression调用了ie不支持的方法引起js错误提示。IE这SB只知道第1行、第xx个字符出错了,不可信。
2011年11月27日
2010年02月28日
页面内附件自动下载
很多人问页面内怎样自动下载文件
其实是很简单的,只要在页面尾部加js
1 2 3 | <script type='text/javascript'> location="附件地址"; </script> |
2009年08月18日
SyntaxHighlighter 很不错的js版的代码高亮显示工具
SyntaxHighlighter is a fully functional self-contained code syntax highlighter developed in JavaScript. To get an idea of what SyntaxHighlighter is capable of, have a look at the demo page.
The project was started in 2004 and since then has gained a lot of acceptance. Version 2.0 is the new page in history of the project representing a near complete rewrite, clean up, optimization, standard compliance and new features.
项目地址http://alexgorbatchev.com/wiki/SyntaxHighlighter
2009年08月13日
让FCKEditor 2.6.4.1 能插入 视频和音频
一、分别打开:editor/js/fckeditorcode_ie_1.js和/editor/js/fckeditorcode_gecko_1.js
找到程序代码 .swf
改成 .(swf|mov|qt|avi|wmv|asf|wma|mid|mp3|mpg|rm|ra|rmvb|ram)
二、打开/editor/dialog/fck_flash/fck_flash.js
1、增加程序代码
// DP 20090813
function WinPlayer(url){
var r, re;
re = /.(avi|wmv|asf|wma|mid|mp3|mpg)$/i;
r = url.match(re);
return r;
}
function RealPlayer(url){
var r, re;
re = /.(rm|ra|rmvb|ram)$/i;
r = url.match(re);
return r;
}
function QuickTime(url){
var r, re;
re = /.(mov|qt)$/i;
r = url.match(re);
return r;
}
function FlashPlayer(url){
var r, re;
re = /.swf$/i;
r = url.match(re);
return r;
}
2、替换程序代码
SetAttribute( e, 'type' , 'application/x-shockwave-flash' ) ;
SetAttribute( e, 'pluginspage' , 'http://www.macromedia.com/go/getflashplayer' ) ;
为
if(WinPlayer(GetE('txtUrl').value)!=null){
SetAttribute( e, 'type' , 'application/x-mplayer2' ) ;
SetAttribute( e, 'autostart', GetE('chkAutoPlay').checked ? 'true' : 'false' ) ;
}
if(RealPlayer(GetE('txtUrl').value)!=null){
SetAttribute( e, 'type' , 'audio/x-pn-realaudio-plugin' ) ;
SetAttribute( e, 'autostart', GetE('chkAutoPlay').checked ? 'true' : 'false' ) ;
}
if(QuickTime(GetE('txtUrl').value)!=null){
SetAttribute( e, 'type' , 'video/quicktime' ) ;
SetAttribute( e, 'autostart', GetE('chkAutoPlay').checked ? 'true' : 'false' ) ;
}
if(FlashPlayer(GetE('txtUrl').value)!=null){
SetAttribute( e, 'type' , 'application/x-shockwave-flash' ) ;
SetAttribute( e, 'scale', GetE('cmbScale').value ) ;
SetAttribute( e, 'menu', GetE('chkMenu').checked ? 'true' : 'false' );
SetAttribute( e, 'play', GetE('chkAutoPlay').checked ? 'true' : 'false' ) ;
SetAttribute( e, 'pluginspage' , 'http://www.macromedia.com/go/getflashplayer' ) ;
}
替换程序代码
SetAttribute( e, 'type' , 'application/x-shockwave-flash' ) ;
为
if(WinPlayer(GetE('txtUrl').value)!=null){
SetAttribute( e, 'type' , 'application/x-mplayer2' ) ;
}
if(RealPlayer(GetE('txtUrl').value)!=null){
SetAttribute( e, 'type' , 'audio/x-pn-realaudio-plugin' ) ;
}
if(QuickTime(GetE('txtUrl').value)!=null){
SetAttribute( e, 'type' , 'video/quicktime' ) ;
}
if(FlashPlayer(GetE('txtUrl').value)!=null){
SetAttribute( e, 'type' , 'application/x-shockwave-flash' ) ;
}
三、修改D:\yulans\web\js\fckeditor\editor\filemanager\connectors\php\config.php
$Config['AllowedExtensions']['Flash'] = array('swf','flv') ;
改成
$Config['AllowedExtensions']['Flash'] = array('swf','flv','mov','qt','avi','wmv','asf','wma','mid','mp3','mpg','rm','ra','rmvb','ram') ;