Page 1 of 1

Should index.htm?section.htm#topic work?

Posted: Mon Jul 20, 2009 4:12 pm
by therube
Should this construct work?

Code: Select all

index.htm?section.htm#topic
URL: http://www.vista-software.com/help/index.htm?functions.htm#datetime

With vista-software.com Allowed, the page loads as expected.
The index on the left, the functions section on the right & the page is advanced to the datetime tag.

If vista-software.com is blocked then you only get the index on the left & index's main page displaying on the right.

Re: Should index.htm?section.htm#topic work?

Posted: Mon Jul 20, 2009 5:50 pm
by Giorgio Maone
Of course, #hash (fragment) scrolling works independently of JavaScript, but in the page you're loading with the URL containing it.
In your example, the page with the content to be scrolled is inside a nested frame, and the top window uses a script to make it scroll.
Tested on Safari with scripts disabled, same effects as Firefox + NoScript.

Re: Should index.htm?section.htm#topic work?

Posted: Mon Jul 20, 2009 6:17 pm
by therube
Let me rehash to make sure I'm understanding ...

#datetime will only work in the context of the URL in which it is found.
(Which in this case is, http://www.vista-software.com/help/functions.htm.)

So in that respect, index.htm?functions.htm#datetime is not exactly kosher, in that as a "URL" alone it does not do what one is expecting. (They are actually parsing the URL line to determine what to do.)

It only happens to work because index.htm has JavaScript code that allows it to work.

And because it relies on JavaScript, with NoScript blocking JavaScript then the end result is as expected.

Thanks.

Re: Should index.htm?section.htm#topic work?

Posted: Mon Jul 20, 2009 6:29 pm
by therube
View Page Source, while either frame has focus, gives:

Code: Select all

<script LANGUAGE="JavaScript">
<!-- Begin

// index.htm?page.htm#topic
// alert(location.search);      // ?page.htm
// alert(location.hash);        // #topic

var blank = " ";                // blank page
var szTableOfContents = "intro.htm";
var szContent = (location.search) ? location.search.substring(1, location.search.length) : szTableOfContents;
if(location.hash)
{
    // "page.htm" -- > "page.htm#topic"
    szContent = szContent + location.hash;
}

// enable query string initial frame
// thanks to http://javascript.internet.com/navigation/dynamic-frameset.html
// alternative at http://archive.webpronews.com/articles/1031md.html
function fillFrame()
{
    // Just point to what they asked for (called via onLoad)
    // file:///C:/_vTask/Help//index.htm?actions.htm#favorites
    //alert(szContent);
    parent.main.location.href = szContent;
}
//  End -->
</script>


<TITLE>vTask - User's Guide</TITLE>
<meta name="Description" content="vTask - User's Guide">
<LINK rel="SHORTCUT ICON" href="http://www.vista-software.com/images/vista.ico">
</head>

<frameset cols="25%,*" frameborder="1" framespacing="1" border="1" onLoad="fillFrame();">

<frame name="index" src="_contents.htm">
<frame name="main" src="intro.htm">
<NOFRAMES>Sorry, this site is only compatible with frames-enabled browsers</NOFRAMES>
</frameset>
</html>