#include directive does not work in HTML-VBForums
Results 1 to 5 of 5

Thread: #include directive does not work in HTML

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2003
    Posts
    2

    #include directive does not work in HTML

    Hi,
    I need to call Html file from another HTML file. To accomplish this I use Include tag as:

    <!-- include file ="file:///E|/vb/vbToweb/test2.html" -->

    but this doesn't work in both browsers IE and netscape

    Early response will be highly appreciated.

    Thanks,

    Hina

  2. #2
    Fanatic Member RealisticGraphics's Avatar
    Join Date
    Jul 1999
    Location
    Arkansas
    Posts
    655
    The #include directive only works server side. The best way to accomplish what you need is to use ASP or JSP. The only way I know of to include any other file for you HTML page is with JavaScript. For Example:

    Code:
    <script language="JavaScript" src="scripts/main.js"></script>
    Then you can call functions that are in that JS file to build sections of your page.
    www.RealisticGraphics.net

    Running VS.Net Enterprise & VB 6

    Other Languages: JavaScript, VBScript, VBA, HTML, CSS, ASP, SQL, XML

    MSN Messenger: kmsheff

  3. #3
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196
    You can use Frames or the iFrame, the iFrame might behave oddly with different browsers though.

  4. #4
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    The server must suppor SSI (server-side includes), and the file must have a .shtml (I think) extension.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  5. #5

    Thread Starter
    New Member
    Join Date
    Sep 2003
    Posts
    2

    Thanks

    Thanks all of you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.