title: Making a function affect a element in another page
body: <p>I made a function that is invoked for the lack of better words from a page, lets call it Page1, the function is called when a button is clicked, at the end of said function it calls another one that creates (or should seeing I haven't been able to test it) a html and appends it to a div with a #lista id.</p>
  
  <p>The problem is that this div is another page (Page2), so I don't know if there is some syntax like in ajax where you specify where you want those values to go, so basically page 1 calls a function (on another file just in case) that function calls another and the result of that function goes on Page1 (another file, again just in case)</p>
  
  <p>Here is my jQuery/JS code to further illustrate:</p>
  
  <pre><code>$("#btnAceptar").click(function() {
     var idlab = $('#txtNumLab').val(),
     capacidad = $('#txtCapacidad').val(),
     carrera = $('#txtCarrera').val(),
     ubicacion = $('#txtUbicacion').val();
  
  
    var request = $.ajax({
      url: "includes/functionsLabs.php",
      type: "post",
      data: {
  
       'call': 'addLab',
       'pIdLab':idlab,
       'pCapacidad':capacidad,
       'pCarrera':carrera,
       'pUbicacion':ubicacion},
  
      dataType: 'json',
  
        success: function(response){
          alert('exito')
  
      agregar();        
  
       }
    });
  });
  </code></pre>
  
  <p>This function should affect a element with id #Lista on Page2.</p>
  
  <pre><code>function agregar(){
  
   var div = $( "#lista" ).append( "&lt;div class='box'&gt;
            &lt;p&gt;Lab #'numero'&lt;/p&gt;                                  
            &lt;p class='info'&gt;&lt;a href='#' id='lnkInfo'&gt;Info&lt;/p&gt;&lt;/a&gt;
            &lt;p class='info'&gt;&lt;a href='reservarLab.html'&gt;Reservar&lt;/p&gt;&lt;/a&gt;
        &lt;/div&gt;" );
  
  
  
  div.id = querySelectorAll('#lista &gt; div').length +1;
  var numero = div.id;  
  $('#numero').append(div); 
  
  
  }
  </code></pre>
  
  <p>Thanks a lot in advance!</p>