Is this possible?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jimmy

    #1

    Is this possible?

    I was wondering if it's possible to have a function add an image to
    the body of a page without opening a new page (ie. what happens when
    you use document.write( '<img src="blah">'); ). I know how to make the
    function swap one pic for another, but I want to know if it's possible
    to add a completely new pic. Or anything for that matter... text,
    horizontal rules... Thanks for the help.

    Jimmy
  • Hywel Jenkins

    #2
    Re: Is this possible?

    In article <9b44d83f.03100 22225.65e222a5@ posting.google. com>,
    galloja@auburn. edu says...[color=blue]
    > I was wondering if it's possible to have a function add an image to
    > the body of a page without opening a new page (ie. what happens when
    > you use document.write( '<img src="blah">'); ). I know how to make the
    > function swap one pic for another, but I want to know if it's possible
    > to add a completely new pic. Or anything for that matter... text,
    > horizontal rules... Thanks for the help.
    >[/color]
    You could create a new DOM element and add the image. Never done it,
    don't know the code, but a quick google should yield something.

    --
    Hywel I do not eat quiche


    Comment

    • Lasse Reichstein Nielsen

      #3
      Re: Is this possible?

      Hywel Jenkins <hyweljenkins@h otmail.com> writes:
      [color=blue]
      > You could create a new DOM element and add the image. Never done it,
      > don't know the code, but a quick google should yield something.[/color]

      Otherwise, here is one:

      var myImg = document.create Element("img");
      myImg.src = "...url..." ;
      document.body.a ppendChild(myIm g);

      /L
      --
      Lasse Reichstein Nielsen - lrn@hotpop.com
      Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
      'Faith without judgement merely degrades the spirit divine.'

      Comment

      Working...