LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-29-2015, 04:08 PM   #1
Ulysses_
Senior Member
 
Registered: Jul 2009
Posts: 1,303

Rep: Reputation: 57
Html that loads another html page on the same folder


I routinely export all bookmarks onto an html and this is my home page. When this is loaded, the dns prefetch annoyingly sends hundreds of dns requests. To disable dns prefetch for this page only, it requires this line to be added to the html:

<meta http-equiv="x-dns-prefetch-control" content="off">

Which is lost every time the bookmarks are exported. Instead, it would be nice if an additional html was used and set as the home page that loads the actual bookmarks html while disabling dns prefetch as above.

How does an html page load another html page located on the same folder?

Last edited by Ulysses_; 11-29-2015 at 04:12 PM.
 
Old 11-29-2015, 06:52 PM   #2
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Quote:
Originally Posted by Ulysses_
How does an html page load another html page located on the same folder?
I use the following statements in index.html on one of my sites. I just have to comment/uncomment to redirect to a particular page.
Code:
<meta http-equiv="refresh" content="0; url=home.html">
<!-- <meta http-equiv="refresh" content="0; url=calendar.php">  -->
<!-- <meta http-equiv="refresh" content="0; url=back_soon.html"> -->
The problem with the above is that turning off prefetch only applies to the current page.

From the chrome (didn't check any other browsers) docs:
Quote:
Child frames also inherit the DNS prefetch control opt-out setting from their parent.
So if you can live with your bookmarks in an iframe this should work:
Code:
<meta http-equiv="x-dns-prefetch-control" content="off"> 
<iframe src="bookmarks.html" style="border:none" width="some_width"  height="some_height">
</iframe>
 
Old 11-29-2015, 07:44 PM   #3
Ulysses_
Senior Member
 
Registered: Jul 2009
Posts: 1,303

Original Poster
Rep: Reputation: 57
Just tried it. It does not work with local files. Chrome seems to have dns prefetch disabled for local files. Firefox has it enabled but does not disable it this way.
 
Old 11-29-2015, 08:29 PM   #4
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Sorry, for some reason I thought you were serving the page not just opening it in a browser.
 
Old 11-30-2015, 05:12 AM   #5
Ulysses_
Senior Member
 
Registered: Jul 2009
Posts: 1,303

Original Poster
Rep: Reputation: 57
Any other way to embed an html file inside an html file?
 
Old 11-30-2015, 08:59 PM   #6
Diantre
Member
 
Registered: Jun 2011
Distribution: Slackware
Posts: 515

Rep: Reputation: 234Reputation: 234Reputation: 234
Quote:
Originally Posted by Ulysses_ View Post
Any other way to embed an html file inside an html file?
Yes, there are a few ways. There's a method using JQuery, described here. But I think the HTML5 object tag is particularly useful.
 
Old 12-01-2015, 08:29 AM   #7
Ulysses_
Senior Member
 
Registered: Jul 2009
Posts: 1,303

Original Poster
Rep: Reputation: 57
The HTML5 object tag works. Here's the complete html with the object size adjusted to fit the window:

<TITLE>Bookmarks with dns prefetch disabled</TITLE>

<meta http-equiv="x-dns-prefetch-control" content="off">

<object name="foo" width="100%" height="99%" type="text/html" data="bookmarks.html"></object>

One minor annoyance: you need to open links in a new tab or window otherwise the url does not appear in the url bar and new sites do not appear in history.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
html : force the fonts size for whole html page? Xeratul Programming 6 11-27-2012 11:54 AM
How do I output information from a PHP page to an HTML page? SentralOrigin Programming 3 01-10-2009 01:54 AM
LaTeX to HTML - all on one page jantman Linux - Software 1 12-03-2008 09:12 AM
Konqueror loads when I click html link... rcarr Linux - Newbie 5 09-24-2003 04:14 AM
Color html editor that loads fast? SharpyWarpy Linux - Software 4 03-16-2003 02:58 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration