Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7707835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:27:38+00:00 2026-06-01T00:27:38+00:00

So I have 2 browsers running, both with the same page. In this page

  • 0

So I have 2 browsers running, both with the same page. In this page you can log into the server with an account.

The connection is build with Strophe. And everything is HTML and javascript.

Now I already managed to build a chat (between the 2 browsers, each logged in with a different user). And this is working perfectly.

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’)

Now, I create my iq with:

    var iq = $iq({type: 'get', to: this.receiver}).c('query', {xmlns: 'http://jabber.org/protocol/pubsub#retrieve-subscriptions'});
    XmppObject.xmpp.connection.sendIQ(iq);

This is set in a function that can be called by the press of a button.
The listener is build as follow:

    $(XmppObject.xmpp).bind("iq", function(event, data){
    addToStatus('Received an iq: \n');
    handlePong(data.iq);
});

With handlePong as:

    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);
}

Now when client1 sends an IQ to client2 this is the result:

Client1:
Received iq from client2@domain with id pingPong and type result

Client2:

Now is there a way to display in the status of client2 that he got the initial request?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T00:27:39+00:00Added an answer on June 1, 2026 at 12:27 am

    You will need to:

    • Construct an iq with you own namespace, you cannot just simply recycle the existing ones. It will work, but it’s plain wrong.
    • Add a handler on Strophe’s connection to handle this type if iq. You do not do that by using jQuery’s bind. You should use the addHandler on the connection.

    The simplest example I can find doing exactly that is the ping implementation of strophe plugins, see https://github.com/metajack/strophejs-plugins/blob/master/ping/strophe.ping.js

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two scripts on the same page, both running sliders, and the first
I have 2 web sites running on the same server. Web1 needs to transfer
I have an ASP.NET page hosted on IIS6 running in windows 2008 server. The
I'm running into an odd failure. It seems that if I have both an
Let's suppose I have an applet running within a page in a browser. What
This might sound like a reaaaally dumb question but... why do browsers have a
I have my web browsers set to save what I type into text boxes
I have an apache web server running on my ubuntu server box. Recently, I
I have a front-end apache server running in a windows server. The system is
I have an SQL 2008 server running three instances. Each instance is assigned a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.