click to id from external html, append

Discussion in 'JavaScript' started by ernest1a, Jun 2, 2009.

  1. #1
    When user click on Click me, one.html is loaded. Inside this html is <p id="test">Click me2 </p>. I want that after user click on Click me 2 (which appers after he click on first Click me) that second action append <p>third</p>' to #include2 (this id is from one.html).

    Is even possible to do that? Now when I click on Click me 2 nothing happen, like there is no second click function.

    I want to append <p> include on click a <p id="test"
    
    $(function() {
    
                $('#clickme').click(function() {
                    $('#include').load('one.html');
                });
    
                });
    
    
                $('#test').click(function() {
                    $('<p>third</p>').appendTo('#include2');
                });
                });
    
    
    Code (markup):

     
    ernest1a, Jun 2, 2009 IP
  2. Unni krishnan

    Unni krishnan Peon

    Messages:
    237
    Likes Received:
    9
    Best Answers:
    2
    Trophy Points:
    0
    #2
    The question is not so clear. Also i am not sure whether this question deals with any javascript.
    Anyway as per my understanding, i think that when a link in the 2nd html is clicked you want to redirect to the first page and want to append some data to an element/variable - #include2(which is in 1st page).
    Please clarify if my understanding is wrong.
     
    Unni krishnan, Jun 2, 2009 IP