Loading ...
Sorry, an error occurred while loading the content.

Re: [ydn-javascript] Best way to repopulate an img child of a div?

Expand Messages
  • Brian McCullough
    ... Thank you, Satyam. Once again you have helped me with one more step into this wierd world of client-side web programming. Brian
    Message 1 of 3 , Aug 19, 2008
    • 0 Attachment
      On Mon, Aug 18, 2008 at 07:58:13PM +0200, Satyam wrote:
      > You don't need to create a new img element to be able to show a
      > different picture, you can just change the src attribute of the existing
      > img to the new image file and it will do just the same. If the new image
      > is of different size as the original one and the original didn't have
      > width and height settings, it will expand or contract to fit. It it had
      > width or height, you can also change them just as you did with the src.
      >
      > Also, the DOM (not YUI's Dom utility but the w3c DOM object) has
      > removeChild. It is not worth it to create an instance of Element just
      > for one operation, just use the plain DOM one.
      >
      > None of this is JavaScript programming. It is like learning C, the K&R
      > book is small because the language is short,learning to use the ANSI C
      > library is another matter altogether. At first, you don't know what
      > belongs to what part of the environment. JavaScript is not that hard,
      > the DOM, which is the programming interface to the web page, is the hard
      > part. YUI simplifies part of it, parts are so easy (like removeChild)
      > that it is not worth it to trouble yourself with the YUI at all. You'll
      > find your way.


      Thank you, Satyam.


      Once again you have helped me with one more step into this wierd world
      of client-side web programming.



      Brian
    Your message has been successfully submitted and would be delivered to recipients shortly.