File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes jquery, difference between Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply 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: 56187
        
      13

    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.




    [Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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: 56187
        
      13

    Surprise!
     
    I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
     
    subject: jquery, difference between "DOM Insertion, Inside" and "DOM Insertion, outside"?
     
    Similar Threads
    dynamically adding elements to another using javascript
    Prototype and script.aculo.us ToC
    Custom Vector class with 'sorting' capabilities
    problem setting form Action name Dynamically on button click
    Learning Dojo: DOM selection and manipulation.