#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2002
    Location
    Brisbane, Australia
    Posts
    19
    Rep Power
    0

    Lightbulb Bookmark with frames JavaScript


    I have a web site with three frames named left, right and top.
    I want to enable a user to click a link or button, which is located in the top frame to bookmark the current document in the right frame. Any ideas?

    Here is the standard bookmark script:
    <script>

    // message to show in non-IE browsers
    var txt = "Bookmark Us!"

    // url you wish to have bookmarked
    /*
    *
    * I want the URL to refer to the current document in the right
    * frame
    *
    */
    //
    var url = "http://www.codelifter.com";

    // caption to appear with bookmark
    var who = "CodeLifter.com Software and Scripts"

    // do not edit below this line
    // ===========================

    var ver = navigator.appName
    var num = parseInt(navigator.appVersion)
    if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) {
    document.write('<A HREF="javascript:window.external.AddFavorite(url,who);" ');
    document.write('onMouseOver=" window.status=')
    document.write("txt; return true ")
    document.write('"onMouseOut=" window.status=')
    document.write("' '; return true ")
    document.write('">'+ txt + '</a>')
    }else{
    txt += " (Ctrl+D)"
    document.write(txt)
    }
    </script>
  2. #2
  3. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    I *think* you can get the url of the frame through window.frames['frame_name'].location.href

    Does that work?
  4. #3
  5. No Profile Picture
    Senior Citizen
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2001
    Location
    leftcoast
    Posts
    2,019
    Rep Power
    16

    document.write('<A HREF="window.external.AddFavorite(top.right.location,who);" ');

IMN logo majestic logo threadwatch logo seochat tools logo