Free Republic
Browse · Search
General/Chat
Topics · Post Article

Skip to comments.

Goodbye cruel world! "Simple" HTML/Java problem ... Arrghh!
The entire worldwide injurenet ^ | 11-03-2009 | Moi

Posted on 11/03/2009 2:41:25 PM PST by Tunehead54

Help!

I'm using frames and trying to get a website up asap. Please don't suggest css/dreamweaver etc. Thanks.

Problem:

Within a frame I just want (ideally) a FORMS button to reload the whole frames site - eg load index.html - starting at home page in the same window/tab. The first example works as a "Back button" - the second almost works as a home button but it loads the homepage in the current frame. Note: A "leading" space is used to allow the html to display ...

The following works:

---------------------- Forms & Java - "Back Button"
-------- Successfully loads last page in relevant frame
--- Perfect!

< FORM>
NAME="back"
VALUE="BACK"
onClick="history.go(-1)">
< /FORM>

------------------- Almost works as a "Home" button"
------- It loads the home page within the current frame
------- Need it to load the whole home page in the same tab/window

< form action="../index.html" method="get">

< input type="submit" name="B1" " id="B1" value="Home">

< /form>


TOPICS: Cheese, Moose, Sister; Computers/Internet
KEYWORDS: html; java
I was trying to use FORMS because it was the first thing I found for a "back" button and the buttons are created aromatically - no fuss no muss ...

Note: adding "_top" as the target doesn't work: < form action="../index.html target=_top" method="get">

I am not wedded to this approach I just want some simple in-frame navigation buttons ideally: forward, back, specified page & home buttons.

Just a button that would load a URL "www.mysite.com" in the same tab/window would do nicely but a straight

< A Href="www.mysite.com" Home< /A>

loads the home page in the current frame. Sigh.

Any help would be greatly appreciated (simpler is better). FReepers are the best! Any ping lists for html freaks? ;-)

1 posted on 11/03/2009 2:41:26 PM PST by Tunehead54
[ Post Reply | Private Reply | View Replies]

To: Tunehead54
Here, let me go first......

Is your computer turned on?

2 posted on 11/03/2009 2:42:23 PM PST by TexasNative2000 (There's a reason the oath talks about defending the country from enemies both "foreign AND domestic")
[ Post Reply | Private Reply | To 1 | View Replies]

To: TexasNative2000

Yes. All 6 of them. Why? ;-)


3 posted on 11/03/2009 2:45:07 PM PST by Tunehead54 (Nothing funny here ;-)
[ Post Reply | Private Reply | To 2 | View Replies]

To: ShadowAce

.


4 posted on 11/03/2009 2:46:52 PM PST by KoRn (Department of Homeland Security, Certified - "Right Wing Extremist")
[ Post Reply | Private Reply | To 1 | View Replies]

To: Tunehead54

the problem is inherent with frames. you need to remember to use number of frames + 1 in any back button actions and a self-referring action. It’s hard to explain in writing but it’s really self-explanatory when you lay it out step by step.


5 posted on 11/03/2009 2:48:19 PM PST by fortunate sun (Newt who?)
[ Post Reply | Private Reply | To 1 | View Replies]

To: Tunehead54
I always use google to look up a solution when I have coding problems. That said, you may want to use javascript instead of a form. Try this
6 posted on 11/03/2009 2:49:26 PM PST by frankenMonkey ("Natural Born Citizen" - US Constitution, 1787; "Words have meaning" - Barack Obama, 2009)
[ Post Reply | Private Reply | To 1 | View Replies]

To: KoRn

Is ShadowAce a web programmer? Is there a place where various ping lists are listed? Anyone? Buehler? ;-)


7 posted on 11/03/2009 2:50:55 PM PST by Tunehead54 (Nothing funny here ;-)
[ Post Reply | Private Reply | To 4 | View Replies]

To: Tunehead54; rdb3; Calvinist_Dark_Lord; GodGunsandGuts; CyberCowboy777; Salo; Bobsat; JosephW; ...

8 posted on 11/03/2009 2:59:43 PM PST by ShadowAce (Linux -- The Ultimate Windows Service Pack)
[ Post Reply | Private Reply | To 1 | View Replies]

To: Tunehead54
and the buttons are created aromatically

So these buttons are suppose to smell? JOKE!

Without seeing the code or site I'm not sure where you are going wrong. Dealing with frames can be difficult at best. What is the Java applet doing? Give some more details or show your code.

9 posted on 11/03/2009 2:59:52 PM PST by steveo (Two Thousand Ten - Never Again)
[ Post Reply | Private Reply | To 1 | View Replies]

To: Tunehead54

Just my opinion.

Do not use frames. I can think of no good reason to use them for website design and I can’t think of many popular and succesful websites that use them anymore.


10 posted on 11/03/2009 3:01:37 PM PST by arkady_renko
[ Post Reply | Private Reply | To 1 | View Replies]

To: arkady_renko

I’m making an audio-oriented site using yahoo media player which catalogues any mp3s on the page and then plays them consecutively or as you select them - if you change pages then you start over - by using frames the catalogue loads and can be played/paused even while other pages are browsed - at least that’s what I’m working on and why frames made sense at the time. ;-)


11 posted on 11/03/2009 3:12:50 PM PST by Tunehead54 (Nothing funny here ;-)
[ Post Reply | Private Reply | To 10 | View Replies]

To: Tunehead54
<>/Italians<>

12 posted on 11/03/2009 3:17:39 PM PST by Delta 21 (If you cant tell if I'm being sarcastic...maybe I'm not.)
[ Post Reply | Private Reply | To 1 | View Replies]

To: Tunehead54
For the "Home" button, you could just use a link. Like this:

<a href="/index.html" target="_top">Home</a>
I woudln't mess with forms for this.

For the back button, you could do a button:


<button onClick="history.go(-1)">Back</button>
Or you could do a link:

<a onClick="history.go(-1)">Back</a>

13 posted on 11/03/2009 3:25:07 PM PST by cc2k (I have donated to David Harmer, have you? [check my recent reply posts])
[ Post Reply | Private Reply | To 1 | View Replies]

To: frankenMonkey

Looking at that, thanks - Except for QuickBasic and a little assembler for machine level calls I’m a script kiddie - just know enough to be dangerous - but setting up a java command in a forms submit/get is esoteric. - The stupid thing is that I could just copy a “Home” button and use it in an “A Href=”” statement and it works - the “back” button technique suggested there may be a parameter to do as asked a little more elegantly.


14 posted on 11/03/2009 3:27:15 PM PST by Tunehead54 (Nothing funny here ;-)
[ Post Reply | Private Reply | To 6 | View Replies]

To: cc2k
Yes Thanks! - As I said my back button works - I just thought the same form of statement could be used to do the home page reload. The direct A href statement works - I just have to use a "Form" to make a Home button - copy it and use it as the gif button - seemed kind of like cheating. ;-)

PS: I'm cheating anyway - I'm a jscript/cgi/.net newbie just trying to make a few things work! At least with straight html I don't have to cover instances where java is not enabled! ;-)

15 posted on 11/03/2009 3:44:12 PM PST by Tunehead54 (Nothing funny here ;-)
[ Post Reply | Private Reply | To 13 | View Replies]

To: cc2k

Thanks - I may have to go that way but you know way more than I - Is there a parameter using either the “button onClick=” or the
“a onClick=” to load a straight url (http://www.mysite.com)?


16 posted on 11/03/2009 3:55:59 PM PST by Tunehead54 (Nothing funny here ;-)
[ Post Reply | Private Reply | To 13 | View Replies]

To: Tunehead54
Perhaps a better question is, why would your frameset page ever be loaded inside a frame? You might just want to fix that page so that it forces itself into the _top window when loaded.

There are a lot of ways to do this. None are particularly elegant. One method is to use the "onLoad" event on the body tag. It has been a while. Seems like it goes something like this (my javascript might be a bit rusty here)


<body onLoad="if (self != top) { window.open('/index.html','_top','') }">
That will prevent your frameset document from being "framed". Note, change the 'index.html' in the window.open to whatever the document is that contains your frameset.
17 posted on 11/03/2009 4:06:00 PM PST by cc2k (I have donated to David Harmer, have you? [check my recent reply posts])
[ Post Reply | Private Reply | To 15 | View Replies]

To: Tunehead54
See my previous post.

You could also do a <button onclick="window.open('/index.html','_top','')">Home</button>

But in Post 17 I outlined a way to make your index.html check itself when it loads and make certain that is isn't being loaded in a frame. I think that is the better approach. You could use the window.open function on your button to avoid the second loading of the window in the "_top" window, but I would definitely add the onLoad event to unframe yourself, should anyone try to load your main frameset in another frame.

18 posted on 11/03/2009 4:11:14 PM PST by cc2k (I have donated to David Harmer, have you? [check my recent reply posts])
[ Post Reply | Private Reply | To 16 | View Replies]

To: Tunehead54

Frames are the Devil.


19 posted on 11/03/2009 10:34:06 PM PST by Jeff Chandler (A trade: Conservative Anglicans for Liberal Catholics and a heretic to be named later.)
[ Post Reply | Private Reply | To 1 | View Replies]

Disclaimer: Opinions posted on Free Republic are those of the individual posters and do not necessarily represent the opinion of Free Republic or its management. All materials posted herein are protected by copyright law and the exemption for fair use of copyrighted works.

Free Republic
Browse · Search
General/Chat
Topics · Post Article

FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson