zawam
Joined: Oct 13, 2005
# Posts: 90
|
Posted: 02/26/2008 08:00 am
Hey
This is what i am trying to do.
Have a page, with two frames, in the upper frame there is a terms of service, and an agree button, Call it agree.html. in the lower frame there is a warning "Please agree to tos", call that warning.html.
When the terms are agreeded to, the top goes to a control panel, i want the bottom frame to know when the top frame is no longer agree.html.
Like an if statement, if agree.html in upper frame, show warning.html, if not agree.html then show content.html
Any ideas on how i can do this?
Thanks
|
 |
Dinkar
Moderator
Joined: Aug 12, 2001
# Posts: 4270
|
Posted: 02/26/2008 10:35 am
Add JS code to change the source of the lower frame.
|
 |
g1smd
Moderator
Joined: Jul 28, 2002
# Posts: 10086
|
Posted: 02/26/2008 11:14 am
I would completely dump the frames and use PHP includes to build the page at the server end and have some scripting on the server to sort it all out. I wouldn't use Javascript at the browser end.
|
 |
Prowler
Moderator
Joined: Aug 14, 2000
# Posts: 1666
|
Posted: 02/27/2008 12:41 am
When it comes to implementing a solution - many developers never agree on a common theme. It is like the old days where in a clock showroom none of the clocks will be synchronized with each other.
It is like the Perl's motto: 'There's more than one way to do it.'
Use any method which will achieve what you need with the lowest number of man hours spent which at the same time gives you the maximum flexibility.
Another technique to consider is the use of AJAX here.
|
 |
Hampstead
Joined: Feb 20, 2001
# Posts: 1942
|
Posted: 02/27/2008 12:45 am
It could be built in Flash too.
|
 |
g1smd
Moderator
Joined: Jul 28, 2002
# Posts: 10086
|
Posted: 02/27/2008 12:13 pm
Does the solution need to be search-engine friendly?
|
 |
Hampstead
Joined: Feb 20, 2001
# Posts: 1942
|
Posted: 02/27/2008 11:44 pm
if so php would be best.
|
 |
zawam
Joined: Oct 13, 2005
# Posts: 90
|
Posted: 03/04/2008 04:24 pm
Hey
I decided JS was the best solution for the project. I realise i could do this in flash, php, asp and all the other languages, however, it wouldnt work how i wanted it.
Its either PHP and AJAX or HTML and HTML...
Frame use is a must, there is a very good reason, however i dont want to go into it...
I have more or less come up with the solution, its a little rough, might go for AJAX and PHP to perfect it...
|
 |
g1smd
Moderator
Joined: Jul 28, 2002
# Posts: 10086
|
Posted: 03/04/2008 05:09 pm
Not everyone will have JS installed.
SE bots certainly don't execute JS code.
Beware that you might be locking search engines out of your site.
|
 |
Prowler
Moderator
Joined: Aug 14, 2000
# Posts: 1666
|
Posted: 03/05/2008 12:23 am
If it is an internal page like "Accept TOS" then Search engines are not such an issue and the JS route is probably the simplest.
|
 |
zawam
Joined: Oct 13, 2005
# Posts: 90
|
Posted: 03/11/2008 10:50 am
SEO is no worry, it is indeed tos, and other documents.
Still stumped on how to get it to work though. I just need a JS Code to detect if the main frame = x , else
|
 |
Curt
Joined: Eons Ago
# Posts: 3674
|
Posted: 03/12/2008 10:05 pm
Think you are looking for code like this:
The code is testing if the page is the top page in the heirarchy of pages in the browser window or if it falls inside of a frameset. If it is not inside a frameset, it will redirect the page to the frameset that would normally contain that page within it. Hope that makes some sense. There are of course more elaborate codings to use, but the code above is about as simple as it's gonna get.
|
 |