JScript调用activeXObject获取访客的网卡MAC地址,注意只能IE下运行(IE8+没测试),会有安全提示在此页上的ActiveX控件和本页上的其他部分的交互可能不安全。你想允许这种交互吗? 注意选择是,要不报错无法获取源代码如下 html head titleJScript+ActiveX获取访客MAC网卡地址/title /head body object cla..
Selection.getRangeAt简介Returns a range object representing one of the ranges currently selected.使用语法range = sel.getRangeAt(index)参数rangerange 为返回的对象index从0开始,返回指定小标的range对象。负值或者大于等于 rangeCount 的数字将会报错示例var ranges = [];sel = window.getSelection();for(var i = 0; i sel.rangeCou..
Selection.toString()方法介绍返回当前selection对象的文本字符串内容。使用语法str=sel.toString()str:为selection对象中的文本字符串内容参数无描述返回当前选中的文本内容。当传递selection对象到一个需要字符串参数的javascript函数时,toString会自动调用alert(window.getSelection()) // What is calledalert(window.getSelection().toSt..
简介返回用户选择的对象。调用语法selection = window.getSelection() ;selection为Selection 对象。要转为字符串,可以链接空字符或者调用toString方法,将返回选中的文本内容。示例function foo() { var selObj = window.getSelection(); alert(selObj); var selRange = selObj.getRangeAt(0); // do stuff with the range}注意事..
javascript调用flash使用flash.external.ExternalInterface.addCallback注册的方法时,出现了Error: Error calling method on NPObject!错误。 网上找了下说是安全问题uncaught exception: Error calling method on NPObject! [plugin exception: Error in Actionscript. Use a try/catch block to find error.]默认actionscript中不允许..
对于一长串不会自动换行的字符串(如数字和字母连在一起的商品编号或者其他内容),会导致页面或者布局被撑破。要自动换行可以使用word-break:break-all(IE和chrome支持,firefox不支持)。!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdstyle.ellipsis{font-size..
使用javascript动态创建的锚点(anchor),在IE8-下无法跳转都动态创建的锚点部分。 测试代码,通过创建a元素,设置a元素的name后添加到dom中,IE8需要添加xhtml申明才有效果(去掉xhtml申明也和IE7一样无效),IE7无效!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitiona..
使用setTimeout/setInterval绑定事件句柄时,firefox13-会自动给事件处理函数增加一个附加参数,所以做选项卡自动切换功能时,注意这2个函数的使用方法,可能会导致你程序出现bug。firefox14+已经去掉这个功能。Note: Prior to Gecko 13 (Firefox 13.0 / Thunderbird 13.0 / SeaMonkey 2.10), Gecko passed an extra parameter to the callb..
使用jquery的ajax方法ajaxStart,ajaxComplete,ajaxError,ajaxSend,ajaxStart,ajaxStop,ajaxSuccess注册事件,如果没有执行,没反应,请注意你使用的jquery版本,jquery1.8+版本这些方法只能注册事件到document对象上,注册到其他对象上无法响应。As of jQuery 1.8, the .ajaxStart() method should only be attached to document.http..