| | |
"add this site to your bookmarks" in firefox
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2007
Posts: 2
Reputation:
Solved Threads: 0
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.
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?
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.
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<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?
Last edited by Aegist; Apr 13th, 2007 at 1:21 am. Reason: added entire code
•
•
Join Date: Apr 2007
Posts: 2
Reputation:
Solved Threads: 0
Just want to subscribe to the thread...
![]() |
Similar Threads
- How to add games to my site? (ASP.NET)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: What do you use to parse the url?
- Next Thread: AJAX not working on firefox
| Thread Tools | Search this Thread |
acid2 ajax ajaxcode ajaxexample ajaxhelp ajaxjspservlets animate automatically beta box browser bug captchaformproblem checkbox close codes createrange() css cursor debugger decimal dependent disablefirebug dom download dropdown editor element engine enter error events explorer ext file firefox form forms frameworks getselection google gwt gxt hiddenvalue highlightedword hint html htmlform ie8 iframe index internet java javascript javascripthelp2020 jawascriptruntimeerror jquery jsf jsfile jsp jump listbox maps masterpage math media menu microsoft mp4 object onmouseoutdivproblem onreadystatechange paypal pdf php player programming progressbar prototype redirect regex runtime safari scale scriptlets search security select size software sql text textarea unicode w3c window windowofwords windowsxp wysiwyg \n





