Insert HTML Page into Another

We have an IIS web site which contains virtually all static HTML pages.  What I need to do is be able to insert one HTML page into another.  The main page is a "Jobs" page which contained a static list, but I want to be able to insert an HTML file that's updated by a user on our file server.

So I removed the static content and inserted the following code I found that works by inserting the external page content in a box container:
<object width="600" height="800" type="text/html" data="file://FILESERVER/Recruiting/Advertising/JOBS.htm" border="1" ></object>

Open in new window

The problem is it only seems to work with Internet Explorer (10) but doesn't work with Chrome or Firefox.  Chrome displays the box container like IE does but no content.  Firefox doesn't even display the box container.

Is there something else I can use instead?
wchestnutAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
You can either do an iframe or include file.   With an an include, it is just like the file is on the page.  With an iframe, it is like linking to an external page although visually they can have the same look.


http://msdn.microsoft.com/en-us/library/ms525940(v=vs.90).aspx
<!-- #include virtual = "/xyz.hmtl" -->
0
wchestnutAuthor Commented:
Thanks, Padas.   I found some articles on the include file method before, but it doesn't seem to work -- nothing is displayed (no error, either).

<!-- #include virtual = "\\fileserver\Recruiting\Advertising\JOBS.htm" -->

Open in new window


I also tried iframe -- which again works in IE but not Chrome or Firefox.
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
The include file is within the same domain.  If you have your site on mysite.com and your include file lives at mysite.com/Recruiting/Advertising/JOBS.htm then you would use

<!-- #include virtual = "/Recruiting/Advertising/JOBS.htm" -->

The slash is a forward slash / not a back slash \

The iframe should work regardless of the the browser. I use it all the time without issue.
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Dave BaldwinFixer of ProblemsCommented:
Padas, the 'include' requires either an ASP file or SHTML file (server-side includes).  Plain HTML is not parsed for things like 'include' unless you redefine it in the server set up.  For another complete page, you should use an 'iframe' anyway.
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Ok you are right.  It can be done in html but it is supposed to not be very efficient.  

My problem with the iframe is it is not actually on the page and depending on what it is I try and use ajax to place html on a page from another source.  

I have never used the object in the wild but what do you think about

http://jsbin.com/OrEFev/1/edit?html,output
  <!-- see http://jsbin.com/ohUWePu/1/ for orig file -->
  <object data="http://jsbin.com/ohUWePu/1/"></object>

Open in new window


The iframe is going to be the easiest though.

For ajax, I use jquery http://api.jquery.com/jQuery.ajax/
<script>
$.ajax({
  url: "test.html",
  cache: false
})
  .done(function( html ) {
    $( "#results" ).append( html );
  });
<script>

<div id="results"><!-- your html page will show here --></div>

Open in new window

0
Christopher Jay WolffWiggle My Legs, OwnerCommented:
don't know enough, but looked at others problems like this.  Lots of issues with CSS where IE will work anyway, but the others won't.  One person had a rule in CSS for height at 100% and IE was fine, others wouldn't go.  Took the rule out of CSS and all worked.

Another said when using iFrame, IE is the only one that treats "name" the same as "ID" which allows you to accidently set an "ID=name" to pass to iFrame, instead of the "ID" your trying to pass to iFrame, then IE works and it seems like your code is right, but the others fail.
0
Dave BaldwinFixer of ProblemsCommented:
Didn't notice the first time but you have "file://" protocol in there.  ONLY IE will load that.  Firefox and Chrome will never load a local "file://" page from an 'http://' page.  Never, ever.  This page http://code.google.com/p/browsersec/wiki/Part2 will tell you more than you ever wanted to know about the subject.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
wchestnutAuthor Commented:
Yes, the HTML file I want to insert is not on the IIS server but on a separate File server that the user has access to and can freely update it.  I don't want the user to access files directly on the web server if I can help it.

DaveBaldwin, not being close to an expert on this subject, I'm getting the impression the method I'm using now is a big no-no for security reasons.  Are there any other, more secure methods to insert an HTML file the user can easily access -- just not on the IIS server?  Or am I forced to install a web page editor and let them update it directly (or an offline copy and publish it)?
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
What type of information do you want people to update?
0
Dave BaldwinFixer of ProblemsCommented:
Easy access and security are opposing conditions.  You don't want other people editing files on the web server.  You can keep the current editable file on the file server and periodically copy it to the web server.

Depending on the information, you might be able to use a database to store and edit it and write a web page that will display it.
0
wchestnutAuthor Commented:
It was a list of current jobs we have open.  Recruiting wanted to be able to update it whenever they want.

And of course, they no longer need to do this.  They subscribed to a web site for job listings and candidate application processing.  I was given a single line of code from their site that now lists all job openings.  Wish they told me this before.

DaveBaldwin, that's actually our long-term solution  -- whenever I can convince the President we'd be much better off leaving 20 year old, flat-file Clarion database system  (which basically runs the company) and converting it to SQL.

Thanks anyways, guys!
0
Dave BaldwinFixer of ProblemsCommented:
So you're waiting for the Pres to retire, are you?
0
wchestnutAuthor Commented:
Okay, we'll say 'retire'. : )
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Browsers

From novice to tech pro — start learning today.