'Add to Favourites' JavaScript

I'm designing a new course with a number web objects to display various websites within the course (Insert -> Web Object). Here's some javascrip I came across which is supposed to allow the user to add the specified website to their favourites:

<a href="javascript:window.external.AddFavorite('http://www.google.com','Google.com')">
Add this page to your favourites</a>

I've added a button in the course with the above script triggered when the button is clicked. However, nothing seems to happen. Can anyone please help me and let me know where I'm going wrong?

Ideally, I'd like to be able to add a number of URLs to the user's favourites in one go and into one folder.

3 Replies
Ashley Terwilliger

Hi Brian,

I'm not a Javascript expert - so I can't speak to the code you've used, but did want to offer a reminder that when testing Javascript elements you'll want to test within the intended publish environment - as testing it locally could cause these elements to fail. There are also some Javascript best practices you may want to review here.