Results 1 to 2 of 2

Thread: javascript bookmark

  1. #1
    Join Date
    May 2006
    Posts
    98
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Default javascript bookmark

    Hi, Could anyone tell me if I have altered this code correctly. It works fine, although when I download a toolbar for windows vista, it crashes when I click a bookmark link. Having stripped everything away, I concluded that it was to do with this bit of code.

    I added asp to this

    Code:
    <a href="bookmark.php" onclick="addthis_url   = location.href; addthis_title = document.title; return addthis_click(this); ">
    to get this

    Code:
    <a href="bookmark.php" onclick="addthis_url   = 'http://www.mysite.com/artgallery.asp?AuthorTwo=<%=rsCard("authorTwo")%>'; addthis_title = '<%=rsCard("author")%>'; return addthis_click(this);">
    As I said it works but as I dont know javascript not sure if I have done it right.

    Any pointer would be helpful.
    Thanks
    Richard

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You can use the browser's 'view source' when visiting this page to see any differences between the served content and what you expect it to be.

    Not having Vista I would have no way of testing but, if using:

    Code:
    <a href="bookmark.php" onclick="addthis_url   = location.href; addthis_title = document.title; return addthis_click(this); ">
    doesn't crash it, why not just arrange for the href and title of the page to be what your asp code would make them in the above onclick event, they should be anyway, because that's the page the bookmark will take the person to.

    If you are using asp, why is the href PHP? If you are using javascript to set the bookmark, why doesn't the onclick event return false?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •