书签无法在Opera浏览器中使用? [英] Bookmark not working in Opera browser?
本文介绍了书签无法在Opera浏览器中使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我提出了关于Opera Browser Bookmark不工作的问题。
我试过以下这个,
代码1:
如果(window.opera& & window.print){
var elem = document.createElement(' 一个跨度>);
elem.setAttribute(' href',url);
elem.setAttribute(' title',title);
elem.setAttribute(' rel', ' sidebar');
elem.click();
}
此代码我试过但未添加到Opera Book标记列表中。
如何在Opera浏览器书签列表中添加URL。
请有人回复我。
解决方案
这样的事情应该有效:
function AddToFavorites(obj,title,url){
if(window.sidebar){
// Mozilla Firefox Bookmark
window.sidebar.addPanel(title,url,);
返回false;
} else if(window.external){
// IE收藏
window.external.AddFavorite(url,title);
返回false;
} else if(window.opera&& window.print){
// Opera Hotlist
obj.setAttribute(''href'',url);
obj.setAttribute(''title'',title);
obj.setAttribute(''rel'',''sidebar'');
obj.click();
返回false;
}
}
如下所示:
< a href =#onclick =AddToFavorites(这是''你的标题'',''你的网址');>将此页加入书签< / a>
Hi,
I raised question about Opera Browser Bookmark not working.
I Tried this following,
Code 1:
if (window.opera && window.print) {
var elem = document.createElement('a');
elem.setAttribute('href', url);
elem.setAttribute('title', title);
elem.setAttribute('rel', 'sidebar');
elem.click();
}
This code I tried but not added in Opera Book mark list.
How to add URL in opera browser Bookmark list.
Please anyone reply me.
解决方案
Something like this should work:
function AddToFavorites(obj, title, url){ if(window.sidebar){ // Mozilla Firefox Bookmark window.sidebar.addPanel(title, url,""); return false; } else if(window.external){ // IE Favorite window.external.AddFavorite( url, title); return false; } else if(window.opera && window.print){ //Opera Hotlist obj.setAttribute(''href'',url); obj.setAttribute(''title'',title); obj.setAttribute(''rel'',''sidebar''); obj.click(); return false; } }
Call it as follows:
<a href="#" onclick="AddToFavorites(this, ''your title'', ''your url'');">Bookmark This Page</a>
这篇关于书签无法在Opera浏览器中使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文