I have a details view with a sidebar and I would like to allow the user to add the current details to their favorites. I’m current using the following javascript, but I don’t know how to pass the details id to the javascript to generate the link to be added to the users favorites.
My javascript – This doesn’t work of course…
<script language="javascript" type="text/javascript">
function addfav()
{
if (document.all)
{
window.external.AddFavorite("linkToDetailsScreen" , "FavoritesName")
}
}
</script>
Try this:
This adds a favorite for the current page/URL and takes the browser’s window title for the favorite title. See here for details.
BTW: this solution only works in IE. See here, here or here for solution which also work in other browsers.