Solved

Open frameset content at top of page

Posted on 2014-03-29
13
443 Views
Last Modified: 2014-04-01
I'm using an online booking system based on frameset, which is supposed to be optimized for smart phones.  On iPhone, some of the pages open at the middle of the page, instead of the top, and I would like them to open at the top.  Adding javascript, or hash tags to these pages is not affecting this behavior, because the loading of these pages is controlled by a frameset parent.  

I've attached the file which seems to control the loading behavior, hoping you can suggest code to force child pages to open at the top.

loadrsv.docx
0
Comment
Question by:ddantes
  • 6
  • 5
  • 2
13 Comments
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39963386
The problem is you can't use that type of coding.  

From the ios dev docs

Avoid Framesets

https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/CreatingContentforSafarioniPhone/CreatingContentforSafarioniPhone.html

In your code, your doc type is set to
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

Open in new window

You need to use HTML5 or XHTML
https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/CreatingContentforSafarioniPhone/CreatingContentforSafarioniPhone.html

As a side note, putting the below code on a page meant for ios may not be the best idea.  The irony is the wording about your browser is very old and offering to go to microsoft to an IOS user.  Netscape may have been very popular in 1997 - 2000 and was pretty much killed off by firefox and no longer developed as of 2007.  I would assume wherever this came from has to be at least 7 to 10years old.

This is the part I am talking about.
<noframes>
Your browser is very old and does not support frames or JavaScript, therefore, you cannot view this site. The latest browsers can be downloaded, free of charge, from <a href="http://www.microsoft.com">Microsoft</a> or <a href="http://www.netscape.com">Netscape</a>.
</noframes>

Open in new window


If you need to use a frame, use an iframe https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
<style>
iframe#myFrame{
   width:400px;
   height:300px;
  
}
</style>
<iframe id="myFrame" src="http://somesite.com"></iframe>

Open in new window

or
<iframe width="400" height="215" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"
   src="http://www.somesite.com">
</iframe>

Open in new window

0
 
LVL 25

Expert Comment

by:devic
ID: 39963646
some page, that is a page of a frame-set of another domain can do nothing except replace top location

so, if you are using some service from another domain, no one (you or another domain ) can change some behavior from different server

if your parent frame has <a href="#something" and your page has <a name="something", then it will be scrolled to  <a href="#something"

nothing else can be done to foreign domain
0
 

Author Comment

by:ddantes
ID: 39963922
Thank you all for your comments.  Yes, the software is originally ten years old, and the revision I am working with is five years old.  However, online booking systems have become cloud based, and I insist on hosting the system on my own site, not on a third party server, so the options are limited.  Aside from a few quirks, this system has worked well for me for a decade, and I check the alternatives every year without finding a superior solution.

I'll remove the archaic references to browser support.

Changing the frameset to iframe  may be unrealistic.  The software has a complex program which is based on frameset.

Perhaps I haven't applied the hash mark correctly.  If you care to visit www.mauitradewinds.com/RezTest/mobile/availability.html   that will open the system.  Perhaps you can direct me to where I should insert the hash code?
0
 
LVL 25

Expert Comment

by:devic
ID: 39963978
As I see, in your example the frame body (cl0001.html ) should have a <a name="something"></a> and the frame link should have the hash:

<frame name="MainFrame" src="http://www.mauitradewinds.com/RezTest/mobile/0001/cl0001.html#something"
0
 

Author Comment

by:ddantes
ID: 39964010
Thank you.  I haven't succeeded in getting this to work.  At the top of every page, just below the <body> tag, I inserted <span id="at_the_top">I'm on the top</span> and I can see it at the top of those pages when they are loaded.  I edited the javascript in the head section of pages, including cl0001.html:

<script language="JavaScript" type="text/javascript">if(!parent.frames['MainFrame']){parent.location.href='http://www.mauitradewinds.com/cgi-bin/m_rez60load.pl?0001/ab0001.html#at_the_top';}</script>

However, the pages still don't load at the top, with iPhone.   I notice that your code for the frame link omits the cgi script, but I believe that part is essential for integrating the pages with data and the program.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39964047
>pages still don't load at the top, with iPhone
See http:#a39963386  Framesets are not for ios.

Did you try an iframe?  This page seems to work fine on it's own  http://www.mauitradewinds.com/cgi-bin/m_rez60load.pl?0001/cl0001.html#at_the_top
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:ddantes
ID: 39964056
I'm willing to try an iframe, but I've no experience with them.  Could you suggest how I should modify loadrsv.txt?   In an earlier comment you specified some details, but what about the onload specifications?
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39965721
Looking at the documentation, http://www.hallisoft.net/RezEasy_6_Std/rezeasy_std_00000e.htm#an2 it does not seem like you have much choice . Do the sample pages get auto generated using a frameset?  When I tried to surf to the frameset page, it just redirects back to the frameset page.    

The docs show it comes with other templates, are they all frameset?  If you are not able to change this, you have to live with it as is or choose another reservation system that may be more up to date.
0
 

Author Comment

by:ddantes
ID: 39965730
Thank you.  Sample pages are generated using a frameset.  All the templates are frameset.  I've been able to configure this to work well on all devices except iPhone.  It works fine on iPad.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39965743
If you can't surf to the framed page, you can't use a frameset.  Is it the javascript file or cgi that is redirecting.  

I know on all of my own sites, iphone is the largest part of mobile and if you can't get this to work as is, it might be time to look for a more modern system.  I know there are some web based systems and that probably will be the way to go.  The problem with trying to do this on your own server when you are not able to do your own programming is you run to problems just like this.
0
 

Author Comment

by:ddantes
ID: 39965759
cgi is redirecting.  

If you navigate to http://www.mauitradewinds.com/RezTest/mobile/contact.html you are redirected to
http://www.mauitradewinds.com/cgi-bin/m_rez60load.pl?contact.html  which is content loaded in a frameset.

I'm speculating that there must be a way to make the frame parent load the child window at the top of the page.  Any thoughts?

If the child window were forced to scroll to its top before executing a link to the next page, perhaps that would accomplish it.
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 39965780
The rez60std.js file has this code that is probably the culprit.
if (parent.frames['MainFrame']) {
    alert('You are trying to load the booking engine more than once.\nThis is probably becuase you have created links to rezeasy.html\nor rez60load.pl You can avoid this problem by linking directly to\nthe pages in reservation system. Example 0001/bf0001.html\n\nThe booking engine will now restart to correct this error');
    parent.location.href = parent.location.href;
}

Open in new window

It is trying to avoid multiple instances of the same file. Without knowing about this program, it is probably best to leave it as is.

I would start looking for an alternative.
0
 

Author Comment

by:ddantes
ID: 39970929
The issue was resolved by replacing <body> with <body onLoad="window.parent.parent.scrollTo(0,0)"> in each of the child pages.  All of them now scroll to the top when opened.

I'm appreciative of Experts participation.  However, I have some hesitation in awarding points, because the Expert comments didn't really point me in the right direction in this case. Not sure how to close the question in an authentic way which respects everyone?
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now