activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stratio <stra...@hotmail.it>
Subject Re: Problem with Ajax API
Date Mon, 27 Dec 2010 21:56:44 GMT

Ok i'm going almost crazy, i tried it in every different way but everytime i
get the same result. My code works on Chrome and Safari and doesn't work on
Firefox and Opera :(. I tried it both on win 7 and ubuntu... This is the the
index.html page i start with :


<html>

<head>



<script type="text/javascript"
src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'></script>

<script type="text/javascript" src='stomp.js'></script>

<script type="text/javascript" src="jquery-1.4.2.min.js"></script>

<script type="text/javascript" src="amq_jquery_adapter.js"></script>

<script type="text/javascript" src="amq.js"></script>

<script type="text/javascript">

	var amq = org.activemq.Amq;

	amq.init({ uri: 'amq', logging: true, timeout: 45, clientId:(new
Date()).getTime().toString() });	

</script>





</head>



<body bgcolor="lightgreen">



<script type="text/javascript">

	

	function ListenCoordinates()

	{

		alert("Il browser non supporta i websocket");

		

		document.write("<center><strong>Inizio la connessione con le API
Ajax</strong></center>");

			

		var myHandler =

		{

  			rcvMessage: function(message)

  			{

	  			today = new Date();

	  			document.write(today.getHours(), ":", today.getMinutes(), ":" ,
today.getSeconds() ,"  -  ", today.getDate(), "/", today.getMonth(), "/",
today.getYear());

     			document.write("<br/>Coordinate ricevute!<br/>");

  			}

		};



		amq.addListener("test", "topic://ActiveMQFeed", myHandler.rcvMessage);

		//amq.removeListener("test", "topic://ActiveMQFeed");

	  	return false;
	}

	

</script>




<center><h3> javascript:ListenCoordinates() Inizia l'ascolto </h3></center>



<pre id="debug"></pre>



</body>



</html>


The main problem is that under chrome and safari the order of the messages
(connection and subscription to the topic) is  right (I checked with Js
debugger) instead in firefox and Opera it seems that the order is not
correct but i can't understand why....

Thank you in advance for your help and happy holidays :) 
-- 
View this message in context: http://activemq.2283324.n4.nabble.com/Problem-with-Ajax-API-tp3155676p3165519.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message