Web Analytics Made Easy -
StatCounter add to favorites is creating a prb? - CodingForum

Announcement

Collapse
No announcement yet.

add to favorites is creating a prb?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • add to favorites is creating a prb?

    this is my code please test it why it is creating an error in internet explorer

    <A HREF="javascript:window.external.AddFavorite('javascriptfunction(){myRef = window.open('http://localhost:400/bookmarklet/index.php?page='+escape(location.href), 'Bookmarklet','menubar=yes,status=yes,location=no,toolbar=no,scrollbars=yes,width=770,resizable=yes, left=120');setTimeout('myRef.focus()',0);})()',document.title)">Add Results to Favorites</a>

    please please the same code i wish to use for firefox also please correct it?
    thanx in advance.

  • #2
    Internet Explorer is the ONLY browser that allows you to add to the Favorites menu. Most other browsers just use CTRL-D to do that without needing any Javascript (except earlier versions of Opera that used CTRL-T instead).
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

    Comment


    • #3
      Originally posted by felgall View Post
      Internet Explorer is the ONLY browser that allows you to add to the Favorites menu. Most other browsers just use CTRL-D to do that without needing any Javascript (except earlier versions of Opera that used CTRL-T instead).
      Nope, there is way to do it in Mozilla as well:
      Code:
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"  "http://www.w3.org/TR/html4/loose.dtd">
      <html>
      <head>
      <title>Untitled Document</title>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
      <meta http-equiv="Content-Style-Type" content="text/css">
      <meta http-equiv="Content-Script-Type" content="text/javascript">
      <script type="text/javascript">
      function CreateBookmarkLink() {
      title = 'GOOGLE'; 
      url = 'http://www.google.com';
      if (window.sidebar) { // Mozilla Firefox Bookmark
      window.sidebar.addPanel(title, url,"")
      } else if( window.external ) { // IE Favorite
      window.external.AddFavorite(url,title)
      }
      else if(window.opera && window.print) { // Opera Hotlist
      return true;}
      }
      </script>
      </head>
      <body>
      <a href="#" onclick="CreateBookmarkLink();return false">Add to Favorites</a>
      </body>
      </html>
      KOR
      Offshore programming
      -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

      Comment


      • #4
        thank u very much for helping me
        but my prb is still there, here is a link that i provided
        <A class="bookmarklet" HREF="javascriptfunction(){myRef = window.open('http://localhost/dealarmy/bookmarklet/index.php?page='+escape(location.href), 'Bookmarklet','menubar=yes,status=yes,location=no,toolbar=no,scrollbars=yes,width=770,resizable=yes, left=120');setTimeout('myRef.focus()',0);})()"><b>Add to dealarmy</b></A>

        i want that when user click on this link it should adds in his favorties thats why i included it in here
        <A HREF="javascript:window.external.AddFavorite('javascriptfunction(){myRef = window.open('http://localhost/dealarmy/bookmarklet/index.php?page='+escape(location.href), 'Bookmarklet','menubar=yes,status=yes,location=no,toolbar=no,scrollbars=yes,width=770,resizable=yes, left=120');setTimeout('myRef.focus()',0);})()',document.title)">Add Results to Favorites</a>

        but it is generating error please execute and try it.
        Last edited by naeembhatti; Sep 27, 2006, 07:34 AM. Reason: spell mistake

        Comment


        • #5
          Originally posted by Kor View Post
          Nope, there is way to do it in Mozilla as well:
          Code:
          <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"  "http://www.w3.org/TR/html4/loose.dtd">
          <html>
          <head>
          <title>Untitled Document</title>
          <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
          <meta http-equiv="Content-Style-Type" content="text/css">
          <meta http-equiv="Content-Script-Type" content="text/javascript">
          <script type="text/javascript">
          function CreateBookmarkLink() {
          title = 'GOOGLE'; 
          url = 'http://www.google.com';
          if (window.sidebar) { // Mozilla Firefox Bookmark
          window.sidebar.addPanel(title, url,"")
          } else if( window.external ) { // IE Favorite
          window.external.AddFavorite(url,title)
          }
          else if(window.opera && window.print) { // Opera Hotlist
          return true;}
          }
          </script>
          </head>
          <body>
          <a href="#" onclick="CreateBookmarkLink();return false">Add to Favorites</a>
          </body>
          </html>
          That adds it to the Sidebar menu in Mozilla, not to the Favorites menu.
          Stephen
          Learn Modern JavaScript - http://javascriptexample.net/
          Helping others to solve their computer problem at http://www.felgall.com/

          Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

          Comment


          • #6
            Originally posted by felgall View Post
            That adds it to the Sidebar menu in Mozilla, not to the Favorites menu.
            Yes (so that later the user should uncheck the "load this bookmark in the sidebar") but there is no other way for Moz. At least it adds it in the Bookmark, even in a side bar. I know, is not a convenable way, but there is no other...
            KOR
            Offshore programming
            -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

            Comment


            • #7
              Error: &quot;Permission Denied&quot; while adding link to Favorite in i.e

              Error: "Permission Denied" while adding link to Favorite in i.e
              <A HREF="javascript:window.external.AddFavorite('javascriptfunction(){myRef = window.open(\'http://localhost/dealarmy/bookmarklet/index.php?page=\'+escape(location.href), \'Bookmarklet\',\'menubar=yes,status=yes,location=no,toolbar=no,scrollbars=yes,width=770,resizable=y es,left=120\');setTimeout(\'myRef.focus()', document.title);">Add Results to Favorites</a>
              my problem is still there please correct this code.

              Comment


              • #8
                I have nothing to correct, I gave you another code.
                KOR
                Offshore programming
                -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

                Comment


                • #9
                  but i how i put my code in your code bcoz when i put my function in equal to url it generates error?

                  Comment


                  • #10
                    Put the questions here or create a new thread of your own and put the questions there
                    KOR
                    Offshore programming
                    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

                    Comment

                    Working...
                    X