下面这段代码在fireFox和IE中的结果是不同的
function trim (str)
{
return str.replace(/ */g, '');
}
function getTextContent (el)
{
if (el.textContent) return el.textContent;
if (el.innerText) return el.innerText;
if (el.innerHTML) return
el.innerHTML.replace(/( )|( )|( )/g, ' ');
}
here is the text 0.123
tag:javascript 正则
想获得 div的name属性值请使用 div.getAttribute(’name’)
完毕
在del.icio.us上看到 GIGAZINE上的一篇文章。
虽然我不懂日文,但还是被他的标题吸引了。
用google把标题翻译成了英文是这样的:The method of decreasing the memory consumption of Firefox and Thunderbird dramatically
没错!就是一直困扰我的Firefox大量占用内存的问题!
文章写的很清楚明白,配图很说明问题,不懂日文的我也看懂了,在地址栏上输入about:config,然后添加一个布尔型的config.trim_on_minimize,并设定为true,重启firefox就ok了
实际效果呢,我也不确定。我正在观察中,呵呵,这两天他的内存占用还没有超过100M(不到10个tab),:)
如果你实在看不懂,可以用google translate翻译成英文
还是看不懂?那么来问我吧,我给你详细解释,:)