conditionally combining multiple html files

Discussion in 'Javascript' started by alwayswinter@gmail.com, Jul 13, 2005.

  1. Guest

    I currently have a form where a user can enter results from a genetic
    test. I also have a pool of summaries that would correspond to
    different results that a user would enter into the form. I ideally I
    would like to have the user enter their results and then have a master
    summary created with the different word or HTML files on submit.
    (condition 1 + condition 2 = combining/displaying corresponding HTML
    files) I've gotten as far as creating the form and conditionally
    launching IE, but it is the combining of the HTML files based on the
    if/then statements I am having trouble with, if anyone has any
    suggestions it would be very helpful? I'm using HTML, PHP, Javascript
    with a little help from dreamweaver.
    , Jul 13, 2005
    #1
    1. Advertising

  2. web.dev Guest

    Hi alwayswin,

    The problem with is this, Javascript does not have a mechanism in which
    it can include HTML files. What you probably want to do is use PHP
    instead and use the 'require()' or the 'include()' function to bring in
    HTML pages.
    web.dev, Jul 13, 2005
    #2
    1. Advertising

  3. wrote:
    > I currently have a form where a user can enter results from a genetic
    > test. I also have a pool of summaries that would correspond to
    > different results that a user would enter into the form. I ideally I
    > would like to have the user enter their results and then have a master
    > summary created with the different word or HTML files on submit.
    > (condition 1 + condition 2 = combining/displaying corresponding HTML
    > files) I've gotten as far as creating the form and conditionally
    > launching IE, but it is the combining of the HTML files based on the
    > if/then statements I am having trouble with, if anyone has any
    > suggestions it would be very helpful? I'm using HTML, PHP, Javascript
    > with a little help from dreamweaver.


    Could be done with JavaScript, but personally I'd recommend using PHP's
    include function (or is it a keyword?). I think it'd make for a very
    easy, very flexible way of implementing combinations of document
    fragments. Each fragment could also include its own PHP code if you
    wanted to go that way.
    Christopher J. Hahn, Jul 13, 2005
    #3
  4. Randy Webb Guest

    web.dev wrote:

    > Hi alwayswin,
    >
    > The problem with is this,


    The main problem with this post is you don't know (or choose not to) how
    to quote.

    > Javascript does not have a mechanism in which it can include HTML files.


    Sure it does. But whether the UA supports it or not is another question.

    > What you probably want to do is use PHP instead and use the 'require()'
    > or the 'include()' function to bring in HTML pages.


    He would probably end up better off including fragments rather than
    complete HTML pages.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Randy Webb, Jul 14, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arvind
    Replies:
    2
    Views:
    13,448
    Rajesh Tihari
    May 24, 2004
  2. Replies:
    4
    Views:
    937
    M.E.Farmer
    Feb 13, 2005
  3. Replies:
    1
    Views:
    1,174
    Eliyahu Goldin
    Dec 17, 2006
  4. Ishmagel
    Replies:
    2
    Views:
    394
    James Kanze
    Aug 13, 2009
  5. Sten Westerback

    Including .htm files conditionally?

    Sten Westerback, Feb 3, 2004, in forum: ASP General
    Replies:
    2
    Views:
    122
    Igor Tandetnik
    Feb 3, 2004
Loading...

Share This Page