Cannot login agent to finesse using XMPP library

Version 1
    This document was generated from CDN thread

    Created by: Guna Sekhar Reddy on 18-05-2012 03:25:03 AM
    I'm trying to login as an agent to finesse server using Cisco XMPP library. The script I'm using to connect is
     
    client = new jabberwerx.Client();

          var arg = {
                httpBindingURL: 'http://192.168.10.197:7071/finesse/api/User/1025',
                successCallback: function() {
                    alert("agent is connected");   
                },
                errorCallback: function(evt) {
               
                    alert("agent is not connected");
                }
          };
           
          client.event("clientStatusChanged").bind(function(evt) {
            if (evt.data.next == jabberwerx.Client.status_connected) {
                alert("connected");
              client.sendMessage("1025@192.168.10.197", "Hello XMPP User.");
            }
            else
            {
                alert(evt.data.next);
            }
          });

          client.event("messageReceived").bind(function(evt) {
            var message = evt.data;
            var body = message.getBody();
            if (body) {
              alert("From " + message.getFrom() + ": " + body);
            }
          });

          jabberwerx.$(document).bind("ready", function() {
            client.connect("1025@192.168.10.197", "1025", arg);
          });      
     
     
    which is taken from reference documents provided in the XMPP library. However I'm not able to login.
     
    If some one knows how to do this, please help me to learn how to do this.
     
    I would really appreciate your quick help.
     
    Thanks in advance

    Subject: RE: Cannot login agent to finesse using XMPP library
    Replied by: David Lender on 21-05-2012 01:44:20 PM
    Due to same-origin policy (https://developer.mozilla.org/en/Same_origin_policy_for_JavaScript) in browsers, the JavaScript cannot perform JS connections to a host+domain that is different from where the page is being hosted on. There are a few solutions (all having pros and cons).
    1. Create a proxy where a specific path is rerouted to the host:7071. This has a performance impact.
    2. Using CORS (cross-origin resource sharing). This requires server support. http://enable-cors.org/
    3. Create another IFRAME that loads a page with the JW connect code seen below. The IFRAME will then pass all the events and connection information through the iframe to other frames using HTML5 post-message. This is what Finesse does. It requires the use go post-message which is only supported in newer browsers which is one of the reasons Finesse is supported on IE8+ and not lower.
    #1 and 2 above are described in the JW docs http://jabberwerx.cisco.com/jwa//trunk/doc/api/deploymentGuide.html

    Hope this helps!

    Subject: RE: Cannot login agent to finesse using XMPP library
    Replied by: David Lender on 16-08-2012 11:12:09 AM
    A Finesse non-gadget sample is now published to the Tools directory of the Finesse Documentation page here

    http://developer.cisco.com/web/finesse/docs