Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Bookmark on Firefox

Reply
Thread Tools

Bookmark on Firefox

 
 
Pipp
Guest
Posts: n/a
 
      05-05-2007
Hi, this simple code works well to add a bookmark on IE, but it
doesn't work on Firefox
<a href="javascript:window.external.AddFavorite('http ://
www.mysite.com','My site is cool');">

Can someone suggest me something ?

 
Reply With Quote
 
 
 
 
Mad Joe
Guest
Posts: n/a
 
      05-05-2007
// Firefox 1.x+, IE4+ and Opera7+

<script type="text/javascript">
<!-- // Begin
function bookmarksite(title,url){
if (window.sidebar) // Firefox
window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // Opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all) // IE
window.external.AddFavorite(url, title);
}
// End -->
</script>

<a href="javascript:bookmarksite('Page Title',
'http://www.example.com')">Bookmark this site!</a>


Pipp wrote:
> Hi, this simple code works well to add a bookmark on IE, but it
> doesn't work on Firefox
> <a href="javascript:window.external.AddFavorite('http ://
> www.mysite.com','My site is cool');">
>
> Can someone suggest me something ?
>

 
Reply With Quote
 
 
 
 
Pipp
Guest
Posts: n/a
 
      05-06-2007
On Firefox this opens the bookmark on the sidebar, how to open it on
the main window ?

On 5 Mag, 21:36, Mad Joe <(E-Mail Removed)> wrote:
> // Firefox 1.x+, IE4+ and Opera7+
>
> <script type="text/javascript">
> <!-- // Begin
> function bookmarksite(title,url){
> if (window.sidebar) // Firefox
> window.sidebar.addPanel(title, url, "");
> else if(window.opera && window.print){ // Opera
> var elem = document.createElement('a');
> elem.setAttribute('href',url);
> elem.setAttribute('title',title);
> elem.setAttribute('rel','sidebar');
> elem.click();}
>
> else if(document.all) // IE
> window.external.AddFavorite(url, title);}
>
> // End -->
> </script>
>
> <a href="javascript:bookmarksite('Page Title',
> 'http://www.example.com')">Bookmark this site!</a>
>
>
>
> Pipp wrote:
> > Hi, this simple code works well to add a bookmark on IE, but it
> > doesn't work on Firefox
> > <a href="javascript:window.external.AddFavorite('http ://
> >www.mysite.com','Mysite is cool');">

>
> > Can someone suggest me something ?- Nascondi testo tra virgolette -

>
> - Mostra testo tra virgolette -



 
Reply With Quote
 
Mad Joe
Guest
Posts: n/a
 
      05-07-2007
Randy Webb wrote:
> Remove the worthless, non-working, useless comments.


I'm hiding it because of the stupid W3C validators...

> While Firefox may support sidebar, it may not be the only browser that
> does. But, at least this branch of the if half tests for what you are
> using.
> Is there a browser (or even a version of Opera) that doesn't support
> window.print? And, why aren't you testing for what you really want to use?
> IE is far from the only browser that will enter this branch. AOL, for
> one, will pass that test but utterly error out on the call to
> window.external, and, there is *no* way to add a favorite in AOL via
> scripting.


Ask Frankyboy: http://www.dynamicdrive.com/dynamicindex9/addbook.htm

> What happens if scripting is disabled? And, what happens, in IE, when an
> animated gif is on the page? (Test it).


What if somebody plugs our visitor's ass on 220V and torture him to
death while another jerk is recording the whole event for publishing on
YouTube? Maybe we should build a script which could prevent that sick
possibility to avoid the mess with the law.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Incorrect bookmark 'icons' in Firefox SC Firefox 5 12-13-2004 06:36 PM
Bookmark menu item "bug" in FireFox 0.10.1 PR Jarmo P Firefox 1 10-10-2004 02:45 PM
Need a "Bookmark Wizard" for Firefox RipVanWinkle Firefox 3 07-27-2004 07:38 PM
Message searching in Thunderbird and bookmark sorting in firefox John Coxon Firefox 2 07-13-2004 07:34 PM
Bookmark extension or plugin for firefox. TIA roadster3043 Firefox 0 05-07-2004 04:15 AM



Advertisments