Elaine Currie
Long Time Member
Nothing is really work unless you would rather be doing something else
Posts: 853
|
Post by Elaine Currie on Mar 9, 2006 14:48:53 GMT -5
Hello, All I seem to do here is ask questions. I have tried all sorts of things but I can't get a "bookmark this page" button to work for me. I have also noticed that many other 3 Phasers have nice looking bookmark buttons that don't work. I thought it was because I tend to use Mozilla Firefox, but then I recently noticed it with IE as well. Has anyone got a foolproof method that works Firefox as well as IE?
|
|
|
Post by Tom "CloudHand" on Mar 9, 2006 16:28:26 GMT -5
Hi Elaine,
Bookmark does not work for Firefox/Mozilla/Netscape. What I did with javascript is to detect which browser is in use, if IE, then open up the favorites dialog, else display an alert dialog to press CTRL-D. If you want to try this, put this code in your head tag:
<!-- Bookmark this page script --> <Script Language = "JavaScript" Type="Text/JavaScript"> <!-- Hide script from older browsers var urlAddress = "http://www.deals4profit.com"; var pageName = "The Work At Home Outlet"; function addToFavorites() { if (window.external) { window.external.AddFavorite(urlAddress,pageName) } else { alert("Please press CTRL-D to Bookmark this site!"); } } // --> </script>
Then put this code where you want the bookmark button to be:
<center><input type="button" value="Click Here to Bookmark this site!" onClick="addToFavorites()"></center>
--Tom
Edit: of course you will want to change the urlAddress and pageName appropriately.
|
|
|
Post by troyzone on Mar 10, 2006 1:48:19 GMT -5
Hi Elaine, I've also noticed that many "bookmark this site" scripts only seem to work with Internet Explorer. However, I recently implemented one on the site that I am working on that works in both IE and Firefox. The instructions basically get you to make a separate .js file that your web page calls to load the script, and of course there are a couple of additions to be made to your web page to make use of it. I messed with it a bit, and with a little trial and error I got it working on my web page with the code all included in my index.html page without it having to call a separate .js file, but I don't know if there is any advantage or disadvantage to doing this...it was just how I chose to implement it at the time (partly just to see if I could do it since I'm still learning this stuff too). If you follow their instructions though you should be fine. I can't take credit for finding this code...somebody else was kind enough to post this link elsewhere on this forum, which is how I found it and decided to give it a try. If you are interested in it, the code and instructions can be found here: javascript.internet.com/miscellaneous/bookmark-page.htmlI've always used Internet Explorer but recently installed Firefox for testing purposes, so I verified that this code will open up a bookmark/favorites window in both browsers. Hope this helps. Troy
|
|
Elaine Currie
Long Time Member
Nothing is really work unless you would rather be doing something else
Posts: 853
|
Post by Elaine Currie on Mar 10, 2006 3:10:39 GMT -5
Hi Tom and Troy,
I have just put a working bookmark button on my index page at last!
I used the one Tom posted. I had already tried the other one (I too saw it posted on this forum) but just could not get it to work and couldn't see that I was doing anything wrong.
Regards, Elaine
|
|
|
Post by troyzone on Mar 10, 2006 3:36:19 GMT -5
Glad you got it working Elaine. I agree that Tom's code is easier to implement and requires less steps. I was like you though and wanted a bookmark button that worked in Firefox as well as IE, so when I saw that other code posted previously I was bound and determined to make it work and I did, but not without some trial and error first though. I can build computers in my sleep but I consider myself a novice when it comes to HTML. Right now I know just enough HTML to be dangerous I'm working on improving that though. Troy
|
|
|
Post by Tom "CloudHand" on Mar 10, 2006 12:45:14 GMT -5
Troy--
Thanks for that link, I like the idea of getting the bookmark to work with Firefox instead of telling the viewer to press CTRL-D.
Elaine--
I modified the code so it works for either IE or Firefox, just copy this code into your head tag:
<Script Language = "JavaScript" Type="Text/JavaScript"> <!-- Hide script from older browsers var urlAddress = "http://www.deals4profit.com"; var pageName = "The Work At Home Outlet"; function addToFavorites() { if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) { window.external.AddFavorite(urlAddress,pageName); } else if (navigator.appName == "Netscape") { window.sidebar.addPanel(pageName,urlAddress,""); } else { alert("Please press CTRL-D(Netscape) or CTRL-T(Opera) to Bookmark this site!"); } } // --> </script>
Change the urlAddress and pageName accordingly.
Regards,
--Tom
|
|
Elaine Currie
Long Time Member
Nothing is really work unless you would rather be doing something else
Posts: 853
|
Post by Elaine Currie on Mar 10, 2006 13:32:14 GMT -5
Hi Troy, Glad to see you are working on improving - I'm working on getting more dangerous as well. I wasted hours trying to get that script to work. I knew it could work because I saw it on someone else's site and when I clicked the button Firefox popped a little box up for me to choose the bookmark destination. I don't know what I was doing wrong but I spent so much time on it I never wanted to see that yellow box again! Hi Tom, I'll try that out. Thank you. This is really bugging me. Now I've wasted so much time I am determined to get it to work.
|
|