Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 474
  • Last Modified:

Open frameset content at top of page

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
ddantes
Asked:
ddantes
  • 6
  • 5
  • 2
1 Solution
 
Scott Fell, EE MVEDeveloperCommented:
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
 
devicCommented:
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
 
ddantesAuthor Commented:
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
devicCommented:
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
 
ddantesAuthor Commented:
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
 
Scott Fell, EE MVEDeveloperCommented:
>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
 
ddantesAuthor Commented:
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
 
Scott Fell, EE MVEDeveloperCommented:
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
 
ddantesAuthor Commented:
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
 
Scott Fell, EE MVEDeveloperCommented:
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
 
ddantesAuthor Commented:
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
 
Scott Fell, EE MVEDeveloperCommented:
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
 
ddantesAuthor Commented:
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 6
  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now