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.

Results 1 to 10 of 10

Thread: Sorce Code

  1. #1
    cgf
    cgf is offline
    Junior Member
    Join Date
    Feb 2003
    Posts
    16
    Member #
    758
    Guys,

    I’m trying to open all my windows in the main frame of my frame set... However I am using a java script to create a type of menu... The problem that I keep having is that I am unable to open any of the links from the menu in the main frame, they insist on opening in the frame where the menu is (i.e. location).... Please look at the example I have put on the web: http://www.westendrugby.pwp.blueyonder.co.uk..

    I have also attached the source code that I am using…..

    This is really urgent!!! Any advice guys
    Thanks!!!!
    Happy go lucky!!!

  2.  

  3. #2
    Senior Member
    Join Date
    Mar 2002
    Location
    Alabama sans the damn flag
    Posts
    263
    Member #
    38
    ummmmm....If I'm reading this correctly (always a suspicious proposition) the problem you are having is that the links pages insist on opening in the frames and not at the top?

    There are two solutions:

    1. In the links set target=_top.

    if, for some reason, this isn't possible, then you can place the following code at the top of each page that must break out of the Frameset:

    Code:
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    if(top.document != this.document)
    {
    top.document.location.href = this.document.location.href;
    }
    //--> 
    </script>
    DerFarm
    I talk to squirrels.
    Squirrels Answer.

  4. #3
    cgf
    cgf is offline
    Junior Member
    Join Date
    Feb 2003
    Posts
    16
    Member #
    758
    Thanks for replying....

    Err!!! not quit... I need the window to open in the main frame which is at the bottom.... The problem that I am having is that I am unable to get it to work.. Here is the code:
    <script language="JavaScript">
    <!--
    function movein(which,html){
    which.style.background='333399'
    description.innerHTML=html
    }
    function moveout(which){
    which.style.background='cc0000'
    description.innerHTML='&nbsp;'
    }
    //-->
    </script>

    [Body]

    <span id="c1" style="color:navy;" onClick="pop(datac1)" onMouseOver="MouseOver(c1)" onMouseOut="MouseOut(c1)"><b><u>

    <td class="menu" bordercolor="black" id="choice1" style="background-color:cc0000; cursor:hand" onmouseover="movein(choice1,'The Latest Forcast')" onmouseout="moveout(choice1)" onclick="location.href='http://www.bbc.com'" width="28%"><font color="#FFFFFF" size="2">
    Weather Report</font></td>
    </tr>

    Thanks!!!!
    Happy go lucky!!!

  5. #4
    Senior Member
    Join Date
    Mar 2002
    Location
    Alabama sans the damn flag
    Posts
    263
    Member #
    38
    well, if you want to go to a specific page within the frameset, you have to meet a number of conditions.

    First, each frame must have unique name. I assume that you did this.

    Then, you have to tell it WHICH frame to go to upon click or whatever.

    In asp, this is how I did it:

    Code:
    ThisForm="<Form name='LoadType' method='Post' action='TotalSQL.asp' target='PatientRecordsFrame'>"
       PatModifyForm="<form name='TotalPatModify' method='Post' action='DemoOriginalData.asp' target=_top> "
    You can have as many forms as needed on a page, although with client-side scripting, you usually don't need more than 1.

    If you use multiple forms, the button that moves from page to page must be enclosed in the open and ending form:

    Code:
       Response.write ThisForm
       Response.write PatActiveButton
       Response.write "</form>"
    DerFarm
    I talk to squirrels.
    Squirrels Answer.

  6. #5
    cgf
    cgf is offline
    Junior Member
    Join Date
    Feb 2003
    Posts
    16
    Member #
    758
    Thanks!!!! DerFarm......

    I have tried all of the above but to no avail.... Any other advice..?

    Thanks!!!!
    Happy go lucky!!!

  7. #6
    Senior Member
    Join Date
    Mar 2002
    Location
    Alabama sans the damn flag
    Posts
    263
    Member #
    38
    ok, just took a look at your source code. You are definitely NOT telling the jpage where to load, therefore, it is loading in the default position, ie: where it is at.

    If you wish all the pages to load in the bottom, you simply add a form:

    <Form name='Dummy' target='whatever the name is for the frameset you wish to hit>

    .....


    </form>

    Try that and see if it works.

    Alternatively, you could try the code that forces the stuff to the top, but you'd have to change it so that it goes to the proper frameset.

    Arien probably could help you with that, I don't know Jscript practically at all and get all wrapped up with syntax and stuff. Rediculous language, really
    DerFarm
    I talk to squirrels.
    Squirrels Answer.

  8. #7
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Can somebody summarize what the question is in 5,000 words or less?
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  9. #8
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    i have only had a quick look through this thread and i am not too sure exactly what you want but try
    Code:
    <base target="x">
    in the head section of your frameset page and the page containting the menu. (x is the name of the frame by the way)
    JR

  10. #9
    Senior Member zionlocke's Avatar
    Join Date
    Jan 2003
    Location
    .: l33t Basement :.
    Posts
    736
    Member #
    483
    Liked
    3 times
    frames... oh... WHAT!!! FRAMES!!! NO!!!

    sorry...
    ok it's just like in html
    <a href="link.html">Link</a>
    - that in you menu frame call it: menu
    - you need the link in the frame to target another frame
    - call that frame: pages
    - the links in the menu frame should be:
    <a href="link.html" target="pages">Link</a>

    I can't see the site so I have no idea what it is suppossed to look like. So, I suggest using regular html on you link. If you are trying to get a button effect using jscript, I suggest button images with rollovers.

    You can easily get a site to load in 10 secs with images everywhere. I still wonder why you are using frames instead of the beautiful tables.
    Cheers, zionlocke :chinese:
    Links: Zion Creation | Blog

  11. #10
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    LOL @ zion. Frames exist. Live with them.

    If the target="x" stuff isn't working, try this confusticated solution:

    in your frameset page, do something like this:

    <html>
    <head>
    &nbsp;&nbsp;<script language="javascript">
    &nbsp;&nbsp;function loadPage(url) {
    &nbsp;&nbsp;&nbsp;&nbsp;document.getElementById("m ainFrame").src = url;
    &nbsp;&nbsp;}
    &nbsp;&nbsp;</script>
    </head>
    <frameset rows="80,*">
    &nbsp;&nbsp;<frame id="navFrame" src="nav.htm">
    &nbsp;&nbsp;<frame id="mainFrame" src="main.htm">
    </frameset>
    </html>

    Then, in your navigation, try something like this:

    <html>
    <head>
    &nbsp;&nbsp;<script language="javascript">
    &nbsp;&nbsp;function loadPage(url) {
    &nbsp;&nbsp;&nbsp;&nbsp;if (window.parent != window) parent.loadPage(url);
    &nbsp;&nbsp;}
    &nbsp;&nbsp;</script>
    <body>
    &nbsp;&nbsp;<a href="javascript:loadPage('new.htm')">Link</a>
    </body>
    </html>

    That's that I don't see why the target=x isn't working, though. I can't see your source code, so I dunno.


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
  •  
All times are GMT -6. The time now is 08:51 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com