code_junkie

Is there a way to request permission in IE to use window.external.AddFavorite?

Nov 13th, 2011
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. <script type="text/javascript">
  2. function addToFavorites() {
  3. if (window.sidebar) { // Mozilla uses sidebar
  4. window.sidebar.addPanel( document.title, window.location , "");
  5. } else if (window.external) { // IE uses window.external
  6. window.external.AddFavorite( window.location, document.title );
  7. } else { // Who knows ? Only have to support IE & Moz anyhow.
  8. alert("Sorry! Your browser doesn't support this function.");
  9. }
  10. }
  11. </script>
  12.  
  13. <a href="javascript:addToFavorites()">Bookmark This Page</a>
Add Comment
Please, Sign In to add comment