所以我最后一次提出这个问题的尝试是含糊不清的。所以我会再试一次。
我创建了一个使用小书签进行填充的系统。现在,在所有主流浏览器(IE8 除外)中,您都可以毫无问题地将小书签拖动/添加到收藏夹。即使尝试手动添加它,它似乎也不起作用。这是代码问题吗?
这是书签代码:
javascript:var metatags, my_arr=document.getElementsByTagName('META'), sel=document.selection.createRange().text,d=document, f, counter;
for(counter=0;counter<my_arr.length;counter++)
{
if(my_arr[counter].name.toLowerCase()=='description')
{
metatags=my_arr[counter].content;
}
}
f='http://xxxxxxxxxxx.co.za/common/UserControls/ShareThis/ShareThis.aspx', l=d.location, e=encodeURIComponent,u=f+'?u='+e(l.href)+'&t='+e(d.title)+'&s='+e(sel.length<1?metatags?metatags:'':sel)+'&v=4';
a=function()
{
if(!window.open(u, 't', 'toolbar=0, resizable=1, scrollbars=1, status=1, width=720, height=570'))
l.href=u;
};
a();
最佳答案
右键单击小书签,然后选择“添加到收藏夹”。然后单击新书签。如果不起作用,则为代码问题。
此外,一般来说,复制/粘贴到 IE8 网址栏也应该有效。
我测试了您的小书签,效果很好。以下是我使用和测试过的并且有效。我通过复制/粘贴到 URL 栏进行了测试。
javascript:var metatags,my_arr=document.getElementsByTagName('META'),sel=document.selection.createRange().text,d=document,f,counter;for(counter=0;counter<my_arr.length;counter++){if(my_arr[counter].name.toLowerCase()=='description'){metatags=my_arr[counter].content}}f='http://xxxxxxxxxxx.co.za/common/UserControls/ShareThis/ShareThis.aspx',l=d.location,e=encodeURIComponent,u=f+'?u='+e(l.href)+'&t='+e(d.title)+'&s='+e(sel.length<1?metatags?metatags:'':sel)+'&v=4';a=function(){if(!window.open(u,'t','toolbar=0, resizable=1, scrollbars=1, status=1, width=720, height=570'))l.href=u};a();
有时小书签问题与将可读代码转换为小书签格式有关。我在上面使用 http://javascriptcompressor.com/ 创建了
关于javascript - IE8 小书签 : Cannot drag to bookmark bar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13704834/