Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Specify bookmark script

  1. #1
    Join Date
    Apr 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Specify bookmark script

    Hi there,

    Not knowing anything about java scripts, I set off in search of a script on the web that I can use on my www.Domain/Frameset.html page which adds www.Domain/ to a user's bookmarks when they 'add to favorites' instead of adding www.Domain/Frameset.html

    - make sense?

    I've spent the last hour looking over search engine results, but can only seem to find variations of the "Bookmark this page" link script, - but I don't wanna add a image or text link

    If anyone has a solution for this problem, I'd be eternally greatful.

    cheers

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Bomu
    make sense?
    Yes, but the answer is you can't. What a user bookmarks is outside of your control.

    By the way, if you really want your visitors to be able to bookmark your pages, you should drop frames (you should drop frames anyway, but that's a different matter). Unless the user understands that they must bookmark the framed page, not the frameset, bookmarking is useless.

    Mike

  3. #3
    Join Date
    Apr 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the reply mwinter. I don't mind if people can't bookmark the framed content pages, I just want to the url they bookmark (if adding the Frameset to their Favorites) to be the index.hml at www.Domain/ rather than the Frameset.html within the website. I guess I can live without a bookmark url specifier, but it woulda been a nice touch if there was such a thing!

    As for dropping the frames~ My website's structure and design at Organic Metal wouldn't work half as well without - not only do I need a top frame with an uninterrupted animated flash loop, but I use frames to allow people the option to view a second version of the site without the Flash loop and navigation, but still making use of the html content pages for both versions.

  4. #4
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Bomu
    As for dropping the frames~ My website's structure and design at Organic Metal wouldn't work half as well without
    The only thing that you couldn't keep with a completely frameless version is the background music as it would stop between page requests. Serving a Flash or Flash-less version is quite feasible as you have server side support. The layout is equally attainable. The question is if you want to make the effort of converting, which I doubt you do. However, if you ever redesign, you should keep frames out of the new version.

    By the way, you might want to change your image fade code to only go to 99% opacity. Firefox has a peculiar bug which manifests itself upon reaching 100%. Someone asked about this on Usenet, so I provided a demo. I produced a revision of the fade code to add support for additional user agents. If you decide to use any of it, use the revised code.

    You can read the Usenet thread via Google Groups.

    Mike

  5. #5
    Join Date
    Apr 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks again for your words of wisdom mwinter- Although it looks a little complicated, I'll look into modifying the fade script I'm using

    I'll also be considering ditching the frames on the next re-design, but until then, do you know of a method I could use to force frames on content pages so that if a page is found outside of the frameset (i.e. via a search engine), a frameset will be automatically generated around that particular content page?

    At the moment, I've implimented the following code to content pages:

    if (window == top) top.location.href = "Domain/FrameSet.html";

    But it only redirects, rather than displaying a framed version of the selected page ...any ideas?

  6. #6
    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

    Quote Originally Posted by Bomu
    if (window == top) top.location.href = "Domain/FrameSet.html";
    How about:
    Code:
    if (window == top) window.location.replace("Domain/FrameSet.html");
    That probably will not do all you want. You need to pass a variable to the frame telling it what content page to display within itself. See this thread:

    http://www.dynamicdrive.com/forums/s...ead.php?t=2237
    - John
    ________________________

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

  7. #7
    Join Date
    Apr 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    jscheuer1~ Sounds like a plan. I checked out the thread link you had posted, but without a decent understanding of javascripting, I couldn't figure it out, not to mention how I could apply something like that to my FrameSet:

    <html>
    <head>
    </head>
    <frameset rows="160,*" cols="*" framespacing="0" frameborder="NO" border="0">
    <frame src="frameTop.htm" name="topFrame" scrolling="NO" noresize>
    <frameset rows="*,19" cols="*" framespacing="0" frameborder="NO" border="0">
    <frameset rows="*" cols="157,*" framespacing="0" frameborder="NO" border="0">
    <frame src="frameLeft.htm" name="leftFrame" frameborder="no" scrolling="no" noresize>
    <frame src="../home.php" name="mainFrame" frameborder="no" scrolling="yes" noresize>
    </frameset>
    <frame src="frameBottom_LOADER.htm" name="bottomFrame" scrolling="NO" noresize>
    </frameset>
    </frameset>
    <noframes>
    <body>
    No Frames Content
    </body>
    </noframes>
    </html>

    Any ideas would be greatly appreciated (providing a complete novice like me can understand them!)

  8. #8
    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

    I can see your problem, I am no expert at JavaScript either but, I figured this out ONLY works in IE6. Here is a template for your content page (I used your work.htm file as an example) that you want to invoke the frameset page with it (the content page) in the frame called 'mainFrame':
    HTML Code:
    <html>
    <head>
    <title>Work</title>
    <script type="text/JavaScript">
    if (window == top) window.location.replace("http://www.organicmetal.co.uk/pages/index2.htm?var1=http://www.organicmetal.co.uk/pages/work.htm");
    </script>
    </head>
    <body>
    Work Content
    </body>
    </html>
    and your index2.htm could look like this:
    HTML Code:
    <html>
    <head>
    <form name="recieve">
    <input type="hidden" name="var1">
    </form>
    <script type="text/JavaScript">
    if (document.all){
    var locate = window.location;
    document.recieve.var1.value = locate;
    var text = document.recieve.var1.value;
    function delineate(str) {
    theleft = str.indexOf("=") + 1;
    theright = str.indexOf("&");
    return(str.substring(theleft, str.length));
    }
    url=delineate(text)
    }
    function refreshFrame() {
    if (document.all){
    if(window.location!=url)
    frames['mainFrame'].window.location.replace(url);
    }
    }
    </script>
    </head>
    <frameset rows="160,*" cols="*" framespacing="0" frameborder="NO" border="0" onload="refreshFrame()">
    <frame src="frameTop.htm" name="topFrame" scrolling="NO" noresize>
    <frameset rows="*,19" cols="*" framespacing="0" frameborder="NO" border="0">
    <frameset rows="*" cols="157,*" framespacing="0" frameborder="NO" border="0">
    <frame src="frameLeft.htm" name="leftFrame" frameborder="no" scrolling="no" noresize>
    <frame src="../home.php" name="mainFrame" frameborder="no" scrolling="yes" noresize>
    </frameset>
    <frame src="frameBottom_LOADER.htm" name="bottomFrame" scrolling="NO" noresize>
    </frameset>
    </frameset>
    <noframes>
    <body>
    No Frames Content
    </body>
    </noframes>
    </html>
    Be sure to notice the onload event in the first framset tag.
    Last edited by jscheuer1; 04-12-2005 at 05:13 PM.
    - John
    ________________________

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

  9. #9
    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

    OK, I've got one that works cross browser for NS7.2, FF1.0.2 and IE6. The sending page format is the same. On the receiving page, lose the form and use this script instead, so that the head section looks like this:
    Code:
    <head>
    <script type="text/JavaScript">
    var text = window.location.href;
    function delineate(str) {
    theleft = str.indexOf("=") + 1;
    theright = str.indexOf("&");
    return(str.substring(theleft, str.length));
    }
    url=delineate(text)
    
    function refreshFrame() {
    if(window.location!=url)
    frames['mainFrame'].window.location.replace(url);
    }
    </script>
    </head>
    Remember to still use the onload event in the first frameset.
    - John
    ________________________

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

  10. #10
    Join Date
    Apr 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Many thanks jscheuer1 - tested it out and it seems to do exactly what I wanted

    I wonder if it would be possible to replace the url:
    var1=http://www.organicmetal.co.uk/pages/work.htm
    to a generic name such as:
    var1=page.url

    Reason I ask, is that I'd then be able to place this content page script within a JS and link that file from each content page, rather than pasting and edititing the script in each individual page.

    Does that make sense?

    but thanks again!

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
  •