This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes jquery, difference between Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "jquery, difference between "DOM Insertion, Inside" and "DOM Insertion, outside"? " Watch "jquery, difference between "DOM Insertion, Inside" and "DOM Insertion, outside"? " New topic
Author

jquery, difference between "DOM Insertion, Inside" and "DOM Insertion, outside"?

Chrix Wu
Ranch Hand

Joined: Nov 15, 2009
Posts: 121
I am reading the jquery API now, but i am comfused about these two:

  • "DOM Insertion, Inside" These methods allow us to insert new content inside an existing element.
  • "DOM Insertion, outside" These methods allow us to insert new content outside an existing element.


  • can anyone explain it to me please? what is existing element refer to? give me an example will be great


    these are the links:
    http://api.jquery.com/category/manipulation/dom-insertion-outside/
    http://api.jquery.com/category/manipulation/dom-insertion-inside/


    ** SCJP 5.0 84% **
    ** SCWCD 1.5 76% **
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 60766
        
      65

    Easy enough.

    "Inside" means just that. The new element becomes a child of the existing element.

    "Outside" means that the new element does not become a child of the existing element, but rather a sibling.




    [Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
    Chrix Wu
    Ranch Hand

    Joined: Nov 15, 2009
    Posts: 121
    Bear Bibeault wrote:Easy enough.

    "Inside" means just that. The new element becomes a child of the existing element.

    "Outside" means that the new element does not become a child of the existing element, but rather a sibling.





    Hi Bear,

    i am currently reading your 《jQuery in Action》, I didn't expect meet you here

    anyway, thanks very much!!
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 60766
        
      65

    Surprise!
     
     
    subject: jquery, difference between "DOM Insertion, Inside" and "DOM Insertion, outside"?
     
    Similar Threads
    Custom Vector class with 'sorting' capabilities
    problem setting form Action name Dynamically on button click
    dynamically adding elements to another using javascript
    Learning Dojo: DOM selection and manipulation.
    Prototype and script.aculo.us ToC