PDA

View Full Version : How do you add an 'add to favourites' button?



pdyeeydv
09-15-2006, 09:05 PM
Anyone know how you add an 'add to favourites' button to your website? The easier the better.

Many thanks.

Collectors-info
09-15-2006, 09:50 PM
Its not a button, but you can change the text on this one. Just change the part in the code that says!
Book mark us to your favourites we would like see you again!
If you want somthing eles.
Then just paste all the code below into a HTML box. Remember to stretch the html box horizontally if the words get on top of each other. If its not compatable with a browser it will say press ctrl D to bookmark us to your visitors. But it works fine with most.

Good luck


Chris.
PS. Will only work when published & not in preview.





<font face="Arial" size="3">
<b>
<script>
</script>
</b>
</font>

<script language="JavaScript">
<!--
// message to show in non-IE browsers
var txt = "Book mark us to your favourites we would like see you again!"
// do not edit below this line
// ===========================

var url = this.location;
var who = document.title;
var ver = navigator.appName
var num = parseInt(navigator.appVersion)
if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) {
document.write('<A HREF="javascript:window.external.AddFavorite(url,who);" ');
document.write('onMouseOver=" window.status=')
document.write("txt; return true ")
document.write('"onMouseOut=" window.status=')
document.write("' '; return true ")
document.write('">'+ txt + '</a>')
}else{
txt += " (Ctrl+D)"
document.write(txt)
}

//-->
</script>

zigzag
09-16-2006, 12:36 AM
This method was posted by Pablo on 22June2005. I used an image of a book, so I will refer to "Image"

In the Page HTML - Between Head Tag - paste this, after changing the "Harrow" url and title to suit your page ...
<SCRIPT LANGUAGE="JavaScript">
function addbookmark()
{
bookmarkurl="http://www.harrow-art.com"
bookmarktitle="Harrow Candle holders & Lamps"
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarkti tle)
}
</SCRIPT>

In the Image Properties (Link), set Link Type to http:
In Image Properties(Link), paste this in the URL box ...
javascript:addbookmark()

In the Image Properties(General), type "Add to Favourites", or similar in the Alternate Text box

davehurst
10-15-2006, 04:39 PM
i just tried this and all i am getting on the website is error on page. any ideas????

AWS
10-31-2006, 03:45 PM
Its not a button, but you can change the text on this one. Just change the part in the code that says!
Book mark us to your favourites we would like see you again!
If you want somthing eles.
Then just paste all the code below into a HTML box. Remember to stretch the html box horizontally if the words get on top of each other. If its not compatable with a browser it will say press ctrl D to bookmark us to your visitors. But it works fine with most.

Good luck


Chris.
PS. Will only work when published & not in preview.





<font face="Arial" size="3">
<b>
<script>
</script>
</b>
</font>

<script language="JavaScript">
<!--
// message to show in non-IE browsers
var txt = "Book mark us to your favourites we would like see you again!"
// do not edit below this line
// ===========================

var url = this.location;
var who = document.title;
var ver = navigator.appName
var num = parseInt(navigator.appVersion)
if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) {
document.write('<A HREF="javascript:window.external.AddFavorite(url,who);" ');
document.write('onMouseOver=" window.status=')
document.write("txt; return true ")
document.write('"onMouseOut=" window.status=')
document.write("' '; return true ")
document.write('">'+ txt + '</a>')
}else{
txt += " (Ctrl+D)"
document.write(txt)
}

//-->
</script>

Hi,

I tried all the above....placed in a html box within my website at http://www.irishpowerlifting.org/home.html and published but on clicking on the bookmark text I keep getting a page error message.

Can anyone help?????

navaldesign
10-31-2006, 05:13 PM
This is an example of bookmark button. A BV advanced button is used.
Please copy the following code in the "Between Head" Tag of your page HTML:
<script type="text/javascript">
/***********************************************
* Bookmark site script- &#169; Dynamic Drive DHTML code library (www.dynamicdrive.com (http://www.dynamicdrive.com))
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
function bookmarksite(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}

For the button properties, select the following:
Button Type: OnClick
OnClick Action : Execute Javascript function
In the OnClick value field type in javascript:bookmarksite('site_title', 'site_URL')
Replace "site_title" with the actual title of your site, f.e. 'Studio Navaldesign'.
Replace 'site_URL' with the actual URL of your site (or that of the specific page), f.e. 'http://www.navaldesign.info'

Please test the script in www.navaldesign.info/Tips/bookmarkbutton.html (http://www.navaldesign.info/Tips/bookmarkbutton.html)

This script was found, as you can see, in Dynamic Drive at http://www.dynamicdrive.com (http://www.dynamicdrive.com)

Oh, it also works in preview.

AWS
10-31-2006, 05:18 PM
Thanks Naveldesign, I knew you would have the solution.