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

Ask for help about NoScript, no registration needed to post
User avatar
therube
Ambassador
Posts: 7969
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

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

Post 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.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.22) Gecko/20090605 SeaMonkey/1.1.17
User avatar
Giorgio Maone
Site Admin
Posts: 9524
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

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

Post 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.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.1 (.NET CLR 3.5.30729)
User avatar
therube
Ambassador
Posts: 7969
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

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

Post 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.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.22) Gecko/20090605 SeaMonkey/1.1.17
User avatar
therube
Ambassador
Posts: 7969
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

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

Post 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>
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.22) Gecko/20090605 SeaMonkey/1.1.17
Post Reply