<a href="#" οnclick="javascript:window.external.AddFavorite('网址','网站标题')" title="收藏本站到你的收藏夹">加入收藏</a>
前天加的时候还是好的,今天就不能用了,IE7浏览器状态栏报错,“找不到元素”,浏览了其他网站,发现也不能添加到收藏夹,于是在网上找到了解决办法:
GWT not working on Internet explorer 7 (IE7) giving "Element not found" javascript error
GWT web application started to give "Element not found" javascript error message on Internet Explorer 7 (IE7)? This application worked fine on Internet Explorer 6 and Firefox 2. Now your best guess would be; GWT not working on IE 7 properly. Wasn't it?
But the scenario became confusing and unbelievable because your application worked fine on IE7 in some machines while not on some others. Have you faced this issue? Then the below solution is for you.
This issue can be fixed by a making a change on windows registry.
Steps to follow are;
1. Open up the Registry editor - type regedit on command prompt.
2. Look for the key shown below
HKEY_CLASSES_ROOT/TypeLib/{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}/1.1/0/win32
3. Click on the "Default" row and see the value there. If it's value is "C:/WINDOWS/system32/shdocvw.dll", then that is what causes the above mentioned issue. If you have installed Windows in a different drive; C:/ must be replaced with the that letter.
4. Replace that value with "C:/WINDOWS/system32/ieframe.dll".
5. Now restart IE7, and load your GWT application.
PS:3和4是说如果注册表里面显示默认的是C:/WINDOWS/system32/shdocvw.dll,就把他替换成C:/WINDOWS/system32/ieframe.dll就可以了。