DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   JavaScript / DHTML / AJAX (http://www.daniweb.com/forums/forum117.html)
-   -   "add this site to your bookmarks" in firefox (http://www.daniweb.com/forums/thread21389.html)

heepofajeep Jan 22nd, 2007 4:16 am
Re: "add this site to your bookmarks" in firefox
 
Quote:

Originally Posted by pablo99 (Post 148010)
Hi Dave,

I'm using Firefox 1.0.6 and as I say the bookmark opens in the sidebar. I see there is an option in the bookmark properties to turn it off, but for some reason it defaults to on when the bookmark is created.

Pablo

X2... I am using Firefox 2.xx

heepofajeep Jan 28th, 2007 9:27 pm
Re: "add this site to your bookmarks" in firefox
 
???

Aegist Apr 13th, 2007 1:15 am
Re: "add this site to your bookmarks" in firefox
 
Hi, two things. First the question about dynamic website name. I use a bit javascript to determine the url (location.href) and then a bit of javascript to determine the pages title (document.title) and assign variables to them. Then use those variables in the link.

I'll give the whole code I use, because my one is slightly different, but really the only difference is the pageurl and pagetitle variables I have set.

<script type="text/javascript">
var pageurl=location.href;
var pagetitle=document.title;

function bookmarksite(title,url){
if (window.sidebar)
    window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){
    var elem = document.createElement('a');
    elem.setAttribute('href',url);
    elem.setAttribute('title',title);
    elem.setAttribute('rel','sidebar');
    elem.click();
}
else if(document.all)
    window.external.AddFavorite(url, title);
}
</script>
<p class="newstext"><a class="news" href="javascript:bookmarksite(pagetitle, pageurl)">Bookmark this page</a></p>


Second thing: Firefox. I'm having the sidebar problem too. And i have firefox 2.x. You can save the bookmark fine, but when you try to open it, it opens in the sidebar. Pretty useless for actually visiting a site!

Anyone have a solution to this?

Aegist Apr 13th, 2007 1:22 am
Re: "add this site to your bookmarks" in firefox
 
Just want to subscribe to the thread...

maa_ku May 21st, 2007 2:48 am
Re: "add this site to your bookmarks" in firefox
 
DaveSW, great script! thanks!


All times are GMT -4. The time now is 12:00 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC