31 users online (1 members and 30 guests)  


Page 1 of 2 1 2 Last
  Results 1 to 15 of 17

Related

  1. Some dofollow social bookmark websites are useful for website promotion    Forum: Search Engine Optimization - SEO - Forum
    Replies: 6
  2. Bookmark Script    Forum: HTML Forum
    Replies: 4
  3. How to add URL to favourites / bookmark    Forum: HTML Forum
    Replies: 3
  1. #1
    Lamont1701's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2005
    Location
    New Jersey, USA
    Posts
    18

    Javascript For BOOKMARK THIS WEBSITE

    Does any out there have the Javascript Code to: “Bookmark This Website”?

    The code that I am using is this: javascript:window.external.AddFavorite('http://www.setiuniverse.com')

    This code works except for two things.

    1. When I click on the hyperlink “Bookmark This Website” the ADD To Favorite’s Box opens up but in the name box it has the URL. I want to be able to add my own text name, for the URL.
    2. Once I click OK the URL is added to Favorites, but then I get an error page. (I think that the script is not exiting properly?) Once I exit out of the error page the original webpage is displayed.

    You can go to the website at: http://www.setiuniverse.com/ to see how it works for yourself. It is located in the left frame under the menu

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    try

    Code:
    javascript:window.external.AddFavorite('http://www.setiuniverse.com', 'Your text here');
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    Lamont1701's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2005
    Location
    New Jersey, USA
    Posts
    18
    Hello: QuietDan

    This script that you helped me with works fine except I am still getting this error after I click OK.

    The page cannot be displayed!


    javascript:window.external.AddFavorite('http://www.setiuniverse.com', 'Seti UNIVERSE');


    Maybe what’s wrong is that I treated the script like a hyperlink? I put the above statement where the hyperlink file name would go?

    I also tried creating a separate webpage for the script then hyperlinked it to the “Bookmark This Website” but I still got the same error.

    Here is an example of the JavaScript that I hyperlinked to “Bookmark This Website”.

    <html>

    <head>

    <script language="JavaScript">
    javascript:window.external.AddFavorite('http://www.setiuniverse.com', 'Seti UNIVERSE');
    </script>

    </head>

    <body>
    </body>

    </html>

  4. #4
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hi,

    yeah your on the right track, its the attempt to follow the js url thats causing the error. Try this

    Code:
    <a href="javascript:void(0);" onclick="window.external.AddFavorite('http://www.setiuniverse.com', 'Seti UNIVERSE');">click me</a>
    Last edited by QuietDean; 03-25-2005 at 03:10 PM. Reason: typo

  5. #5
    Lamont1701's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2005
    Location
    New Jersey, USA
    Posts
    18
    First let me say that I really Thank You for taking the time to help me with this little problem. Well, below is the code that you suggested and how I used it.

    Unfortunately I’m still getting the same error! "The page cannot be displayed!"

    Do you have any more suggestions? :-)

    <html>

    <head>

    <script language="JavaScript">
    <a href="javascript:void(0);" onclick="window.external.AddFavorite('http://www.setiuniverse.com', 'Seti UNIVERSE');">click me</a>
    </script>

    </head>

    <body>
    </body>

    </html>

  6. #6
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Remove the <script language="javascript"> and </script> they are not needed. Just try it as a 'normal' link.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  7. #7
    Lamont1701's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2005
    Location
    New Jersey, USA
    Posts
    18
    Hello Again; QuietDean

    Well it worked, kind of! What happens is a blank webpage comes up, then you must click where it says “click me.” Then the Favorites Box comes up and you proceed normally. When your done the blank page is still there, you must exit from that blank webpage to get rid of it.

    That is better than the way it was before, but it is not perfect! :-) Why don’t you go to the webpage (http://www.setiuniverse.com) and see for yourself? (Maybe you will get some ideas.) I guess that you have guessed by now that I know almost nothing about Javascript.

    Oh yea, I looked around for that icon thingy that gives credit to someone for helping another, but I can’t seem to find it. (I kind of doubt it that you need it, but I wanted to give it anyway.)



    <html>

    <head>
    </head>

    <body>

    <a href="javascript:void(0);" onclick="window.external.AddFavorite('http://www.setiuniverse.com', 'Seti UNIVERSE');">click me --- Then EXIT This Page When Done</a>

    </body>
    </html>


    Anyway "THANKS For The Help!"

  8. #8
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Its a blank page because there is nothing on that page except the javascript.

    Add the

    <a href="javascript:void(0);" onclick="window.external.AddFavorite('http://www.setiuniverse.com', 'Seti UNIVERSE');">click me --- Then EXIT This Page When Done</a>

    As the link on your index page. You dont need a whole page for this javascript, just a single link.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  9. #9
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    give this a go

    HTML Code:
    <html>
    <head>
    </head>
    <body>
    <a href="javascript:window.external.AddFavorite('http://www.setiuniverse.com', 'Seti UNIVERSE')">Bookmark</a>
    </body>
    </html>
    Last edited by HTML; 03-25-2005 at 08:52 PM.

  10. #10
    Lamont1701's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2005
    Location
    New Jersey, USA
    Posts
    18

    SAME RESULT -- Different Code

    Oh well, the results were precisely the same as the last attempt!

    Once again thanks!

    I will leave the website intact with the new code for about an hour or so. Then I will change it back to the previous code. (Only because the text is more descriptive as to what needs to be done!)

  11. #11
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    I do not get why you are opening a new page to do this. Just place the code I gave you on the first page and everything should be fine, it is the same code I always used.

    dave

  12. #12
    Lamont1701's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2005
    Location
    New Jersey, USA
    Posts
    18
    I don’t know why I was so dump, guess I had bit of a (temporary) mental block. However I put the code on my left frame page. (_BORDERS/LEFT.HTM)

    It is working better, but after enter the URL into a folder, then clicking OK the blank page that you have to exit from still appears. It says “The page cannot be displayed”

    Any ideas?

    <a href="javascript:window.external.AddFavorite('http://www.setiuniverse.com', 'Seti UNIVERSE')"><font size="4" color="#FFFFFF"><b>BOOKMARK
    THIS SITE!</b></font></a>


    Lamont

  13. #13
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    I just noticed you have the tag <base target="_blank">, that is what is causing the page change now.

    Dave

  14. #14
    Lamont1701's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2005
    Location
    New Jersey, USA
    Posts
    18
    Hello Once More:

    I have check for the terms “<base target="_blank">” as described in your last posting. That term (statement) that you mentioned is in almost every ad that I have on that page.

    I’ve looked in a Javascript Book and they don’t say much about “target.”

    Is there some way to turn off that function just before the favorites script is executed?

    Is there a specific the “<base target="_blank">” that you were talking about?

    Lamont

    P.S. I even put the Javascript Statement on the Index Page, with the same end result.

  15. #15
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    The one in the <head> controls every link on the page.



Page 1 of 2 1 2 Last

Tags for this Thread