Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15
  1. #1
    Junior Member
    Join Date
    Jun 2003
    Posts
    9
    Member #
    1649
    Hi, I would like to get my naked frames too show the framesets
    my webpage is www.australiansoccer.net

    now using this tutorial http://www.scriptasylum.com/tutorial...eredirect.html

    I have managed to get this naked frame to show its frameset
    http://www.australiansoccer.net/main/main.htm

    the only problem is that even though everything works, the page shows an error message, on line 18 of my code.

    The problem is that I'm not sure how to fix this
    any help would be great

  2.  

  3. #2
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    try changing the fname with the name of the frame, in single quotes 'framename'
    JR

  4. #3
    Junior Member
    Join Date
    Jun 2003
    Posts
    9
    Member #
    1649
    ive tried a few different combos, but still stuck
    Code:
    <script language="javascript">
    var fname= 'default.htm';     //MAIN CONTENT AREA FRAME **NAME**
    
    window.onload=function(){
    var d=document.location.search;
    if(d!='')top.frames[fname].document.location.href=d.substring(d.lastIndexOf('?')+1,d.length);
    }
    </script>
    i replaced
    Code:
    if(d!='')top.frames[fname].document.location.href=d.substring
    the fname with 'default.htm' but didnt seem to make much difference.

    i changed the code to include the full url, but that also didnt seem to work
    Code:
    <script language="javascript">
    if(self.location==top.location)self.location='/default.htm?http://www.australiansoccer.net/main/main.htm';
    </script>
    any suggestions of where i might be going wrong?

  5. #4
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Show us the frameset page. 'default.htm' looks more like a frame.src than a frame.name

  6. #5
    Junior Member
    Join Date
    Jun 2003
    Posts
    9
    Member #
    1649
    I used to have the index.htm as the frameset but I renamed it default.htm as I wanted the frameset as the starting page.

    The rest of the files are located in
    /main/main.htm
    /main/right.htm
    /main/leftbarfull.htm
    /main/banner.htm

    currently the site looks like its down, which is wierd as the host is usually pretty reliable.

  7. #6
    Junior Member
    Join Date
    Jun 2003
    Posts
    9
    Member #
    1649
    hi, sites up and running again, any solutions to my problem

  8. #7
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    I think what you want to do is this:
    Code:
    if (d != '') {
        top.location.href = 
            d.substring(d.lastIndexOf('?')+1, d.length);
    }
    Try that out and tell me what happens.

    It looks like what you're trying to do is redirect the whole page to a value passed in the querystring like this:
    Code:
    <a href="default.htm?redirect_page.htm">
    Not sure why you'd wanna do that, though. Oh well

  9. #8
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Incidentally, you might be trying to do this:
    Code:
    if (d != '') {
        top.document.frames['main'].location.href = 
            d.substring(d.lastIndexOf('?')+1, d.length);
    }
    That redirects the content of your main frame rather than the whole page.

  10. #9
    Junior Member
    Join Date
    Jun 2003
    Posts
    9
    Member #
    1649
    I think we're getting closer (well actually you are, as I have no idea)
    I typed in your code
    -----------------
    Code:
    if (d != '') {
        top.document.frames['main'].location.href = 
            d.substring(d.lastIndexOf('?')+1, d.length);
    }
    ---------------
    I didnt get the line 18 error wohooo

    www.australiansoccer/main/main.htm succesfully opens the frameset but gets the error below
    line 23
    char 1
    Expected '}'


    -----------
    also tried the second code you put, but that didnt seem to work.
    ---------------------------------

  11. #10
    Junior Member
    Join Date
    Jun 2003
    Posts
    9
    Member #
    1649
    I found out that the only code that i needed was
    Code:
    <script language="javascript">
    if(self.location==top.location)self.location="index.html?page_URL_here";
    </script>
    The other code
    Code:
    <script language="javascript">
    var fname="content";     //MAIN CONTENT AREA FRAME **NAME**
    
    window.onload=function(){
    var d=document.location.search;
    if(d!='')top.frames[fname].document.location.href=d.substring(d.lastIndexOf('?')+1,d.length);
    }
    </script>
    Is not needed as I only have one default frameset. If I had more than one framset than i would need the code above

    This is my understanding of the tutorial, as a noob im not sure if im right
    http://www.scriptasylum.com/tutorial...eredirect.html
    correct me if I'm wrong
    ------------------------------------
    incase I have confused anyone my main goal, is to submit my pages to search engines, but when a user gets an individual frame like
    http://www.australiansoccer.net/main/main.htm
    or
    http://www.australiansoccer.net/aussoccer/links.htm
    than I would like that page to show the surrounding framset and not just the individual frame.


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

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

Search tags for this page

my naked frame

Click on a term to search for related topics.
All times are GMT -6. The time now is 09:14 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com