printing an <html> ... </html> string using <href>

Discussion in 'Javascript' started by John, Mar 31, 2007.

  1. John

    John Guest


    var poster="<html><head> ..... etc .... </html>";
    var animal='dog';

    The string contains images and text that changes.

    Originally I wanted to do something like

    print "<a href=" + poster + ">Choose Poster of a " + animal + "</a>";

    When you click the 'Chose Poster of a Dog' another page would appear which
    could be printed.

    I now realise that <href> cannot work in this context.

    What construct should I be using?

    John, Mar 31, 2007
    1. Advertisements

  2. John

    shimmyshack Guest

    var poster="/html/dog.html";
    var animal='dog';

    or use an iframe

    <iframe src="" name="animal" ></iframe>
    <a href="/html/dog.html" target="animal">Choose Poster of a dog</a>
    <a href="html/cat.html" target="animal">Choose Poster of a cat</a>
    and so on for sheep, bats, and crickets.
    shimmyshack, Mar 31, 2007
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.