title: XMPP's IQ exchange between clients with Strophe
body: <p>So I have 2 browsers running, both with the same page. In this page you can log into the server with an account.</p>
  
  <p>The connection is build with Strophe. And everything is HTML and javascript.</p>
  
  <p>Now I already managed to build a chat (between the 2 browsers, each logged in with a different user). And this is working perfectly.</p>
  
  <p>What I want to achieve now is to send an IQ to one user from the other. Both saying in the status bar that they are receiving the IQ (one as a 'got the request', the other as 'got the result')</p>
  
  <p>Now, I create my iq with:</p>
  
  <pre><code>    var iq = $iq({type: 'get', to: this.receiver}).c('query', {xmlns: 'http://jabber.org/protocol/pubsub#retrieve-subscriptions'});
      XmppObject.xmpp.connection.sendIQ(iq);
  </code></pre>
  
  <p>This is set in a function that can be called by the press of a button.
  The listener is build as follow:</p>
  
  <pre><code>    $(XmppObject.xmpp).bind("iq", function(event, data){
      addToStatus('Received an iq: \n');
      handlePong(data.iq);
  });
  </code></pre>
  
  <p>With handlePong as:</p>
  
  <pre><code>    function handlePong(msg)
  {
      var objMsg = $(msg);
      var from = objMsg.attr('from');
      var type = objMsg.attr('type');
      var id = objMsg.attr('id');
      var text = 'Received iq from ' + from + ' with id ' + id + ' and type ' + type + '\n\n';
      addToStatus(text);
  }
  </code></pre>
  
  <p>Now when client1 sends an IQ to client2 this is the result:</p>
  
  <p>Client1:
  <code>Received iq from client2@domain with id pingPong and type result</code></p>
  
  <p>Client2:
  <code></code></p>
  
  <p>Now is there a way to display in the status of client2 that he got the initial request?</p>