Ajax call hanging autobahn.min.js

#1

I’m trying to use a websocket event handler in Javascript to initiate an Ajax pull from a Database. The page receives the command via websockets to update it’s data. I can call any function I want from that websocket event but if it involves an Ajax call it hangs somewhere in the depths of autobahn.min.js. It stops on line 55. Is it something I am doing wrong or mis-understanding?

I’m using the breakpoints in the Developer Tools window of Chromium Version 28.0.1500.71 to trace where it’s stopping.

I’ve got some major deadlines on this project, which my personal deadlines are nobody else’s problem but I have given myself today to resolve this. If I cannot figure it out I will build some sort of a work around. My next best solution is just polling the db but I hate that considering how slick the websockets are working elsewhere in my application.

0 Likes

#2

So what I did to work around it was this:

In the browser page i created an array where I dump the commands coming from the websocket event. Then I, uh… poll that array every second and run the commands and empty them. Works okay, obviously there is up to a second of delay in response. Not really cool when it could be instant with websockets, but, I don’t have time to figure it out right now. Major deadlines coming. Will be resolved in version X. Unless someone chimes in with an answer pretty quick.

Seems like the problem is using the websocket event to fire an Ajax request. The websocket wigs out in autobahn.min.js line 55. I totally expect this to resolve down to some problem on my part…

···

On Wednesday, August 28, 2013 7:57:16 AM UTC-7, Trendal Toews wrote:

I’m trying to use a websocket event handler in Javascript to initiate an Ajax pull from a Database. The page receives the command via websockets to update it’s data. I can call any function I want from that websocket event but if it involves an Ajax call it hangs somewhere in the depths of autobahn.min.js. It stops on line 55. Is it something I am doing wrong or mis-understanding?

I’m using the breakpoints in the Developer Tools window of Chromium Version 28.0.1500.71 to trace where it’s stopping.

I’ve got some major deadlines on this project, which my personal deadlines are nobody else’s problem but I have given myself today to resolve this. If I cannot figure it out I will build some sort of a work around. My next best solution is just polling the db but I hate that considering how slick the websockets are working elsewhere in my application.

0 Likes

#3

I'm trying to use a websocket event handler in Javascript to initiate an
Ajax pull from a Database. The page receives the command via websockets

You mean your receive a WAMP PubSub event?

to update it's data. I can call any function I want from that websocket
event but if it involves an Ajax call it hangs somewhere in the depths
of autobahn.min.js. It stops on line 55. Is it something I am doing
wrong or mis-understanding?

Autobahn does not provide or use Ajax .. so I fail to see how that could be related ..

/Tobias

···

Am 28.08.2013 16:57, schrieb Trendal Toews:

0 Likes

#4

Yes that is correct. I am receiving a WAMP PubSub event. The even handler, in this case checks the data for a keyword. If it exists the event handler pulls some data from a database via a new XMLHttpRequest. If I skip the XMLHttpRequest I can do anything I want in the Javascript PubSub event handler. But if I make the request from inside the handler and then watch the program flow via Chromiums Developer Tools window it jumps into the autobahn.min.js code and then just exits cleanly out of that and the XMLHttpRequest is never answered. If I drop the keyword into an array and poll it all works as expected.

···

On Wednesday, August 28, 2013 11:44:34 AM UTC-7, Tobias Oberstein wrote:

Am 28.08.2013 16:57, schrieb Trendal Toews:

I’m trying to use a websocket event handler in Javascript to initiate an

Ajax pull from a Database. The page receives the command via websockets

You mean your receive a WAMP PubSub event?

to update it’s data. I can call any function I want from that websocket

event but if it involves an Ajax call it hangs somewhere in the depths

of autobahn.min.js. It stops on line 55. Is it something I am doing

wrong or mis-understanding?

Autobahn does not provide or use Ajax … so I fail to see how that could
be related …

/Tobias

0 Likes

#5

Yes that is correct. I am receiving a WAMP PubSub event. The even
handler, in this case checks the data for a keyword. If it exists the
event handler pulls some data from a database via a new XMLHttpRequest.

That should be no problem. You can try without any Autobahn involved .. sth like

var d = $.Deferred();
d.then(function (kw) { /* do your XMLHttpRequest thing */ });
d.resolve("mykeyword");

  If I skip the XMLHttpRequest I can do anything I want in the
Javascript PubSub event handler. But if I make the request from inside
the handler and then watch the program flow via Chromiums Developer
Tools window it jumps into the autobahn.min.js code and then just exits

Why would issueing a XMLHttpRequest jump into Autobahn code?

cleanly out of that and the XMLHttpRequest is never answered. If I drop
the keyword into an array and poll it all works as expected.

Is your code online / can you post it?

···

Am 28.08.2013 20:51, schrieb Trendal Toews:

0 Likes

#6

The whole thing is pretty extensive but I’ll try to share the parts of interest in a bit here. It’s offline. Private webapp for an Industrial Application.

···

On Wednesday, August 28, 2013 11:59:11 AM UTC-7, Tobias Oberstein wrote:

Am 28.08.2013 20:51, schrieb Trendal Toews:

Yes that is correct. I am receiving a WAMP PubSub event. The even

handler, in this case checks the data for a keyword. If it exists the

event handler pulls some data from a database via a new XMLHttpRequest.

That should be no problem. You can try without any Autobahn involved …
sth like

var d = $.Deferred();

d.then(function (kw) { /* do your XMLHttpRequest thing */ });

d.resolve(“mykeyword”);

If I skip the XMLHttpRequest I can do anything I want in the

Javascript PubSub event handler. But if I make the request from inside

the handler and then watch the program flow via Chromiums Developer

Tools window it jumps into the autobahn.min.js code and then just exits

Why would issueing a XMLHttpRequest jump into Autobahn code?

cleanly out of that and the XMLHttpRequest is never answered. If I drop

the keyword into an array and poll it all works as expected.

Is your code online / can you post it?

0 Likes

#7

// This is the function that handles the event data
this.NewDataHandler = function (topic, data)

{

if (data["type"] == "Weightcert")

{       // data["type"] does equal "Weightcert".  That is confirmed

// data[“data”] is a list of database ID’s that get used to pull some data

// So that is where the XMLHttpRequest happens

// The function is called and the XMLHttpRequest is triggered but then the function exits and no data is ever sent back from the server

	D.Podium.Weightcert_Form.list_weightcerts(data["data"]);

}

if (data[“type”] == “Fill Order”)

{

// Handle new fill order…

}

}

The function that pulls the data is as follows:

this.Ajax = function (type, url, sync, func)

{

	var x = new XMLHttpRequest();

	x.open(type, url, sync);

	x.onreadystatechange = function()

		{

			if(x.readyState == 4 && x.status == 200)

			{

				func(x.responseText);

			}

		}

	x.send(null);

}
···

On Wednesday, August 28, 2013 11:59:11 AM UTC-7, Tobias Oberstein wrote:

Am 28.08.2013 20:51, schrieb Trendal Toews:

Yes that is correct. I am receiving a WAMP PubSub event. The even

handler, in this case checks the data for a keyword. If it exists the

event handler pulls some data from a database via a new XMLHttpRequest.

That should be no problem. You can try without any Autobahn involved …
sth like

var d = $.Deferred();

d.then(function (kw) { /* do your XMLHttpRequest thing */ });

d.resolve(“mykeyword”);

If I skip the XMLHttpRequest I can do anything I want in the

Javascript PubSub event handler. But if I make the request from inside

the handler and then watch the program flow via Chromiums Developer

Tools window it jumps into the autobahn.min.js code and then just exits

Why would issueing a XMLHttpRequest jump into Autobahn code?

cleanly out of that and the XMLHttpRequest is never answered. If I drop

the keyword into an array and poll it all works as expected.

Is your code online / can you post it?

0 Likes

#8

This is the code that calls the Ajax function

string is the list of ID’s that gets passed from the websocket event to the XMLHttpRequest. The PHP script uses that to generate a set of data to return.

Ajax(“GET”, “core/GET_weightcert_data.php?weightcerts=” + string, true, this.lst);

···

On Wednesday, August 28, 2013 12:12:59 PM UTC-7, Trendal Toews wrote:

// This is the function that handles the event data
this.NewDataHandler = function (topic, data)

{

if (data[“type”] == “Weightcert”)

{ // data[“type”] does equal “Weightcert”. That is confirmed

// data[“data”] is a list of database ID’s that get used to pull some data

// So that is where the XMLHttpRequest happens

// The function is called and the XMLHttpRequest is triggered but then the function exits and no data is ever sent back from the server

  D.Podium.Weightcert_Form.list_weightcerts(data["data"]);

}

if (data[“type”] == “Fill Order”)

{

// Handle new fill order…

}

}

The function that pulls the data is as follows:

this.Ajax = function (type, url, sync, func)

{

  var x = new XMLHttpRequest();
  x.open(type, url, sync);
  x.onreadystatechange = function()
  	{
  		if(x.readyState == 4 && x.status == 200)
  		{
  			func(x.responseText);
  		}
  	}
  x.send(null);

}

On Wednesday, August 28, 2013 11:59:11 AM UTC-7, Tobias Oberstein wrote:

Am 28.08.2013 20:51, schrieb Trendal Toews:

Yes that is correct. I am receiving a WAMP PubSub event. The even

handler, in this case checks the data for a keyword. If it exists the

event handler pulls some data from a database via a new XMLHttpRequest.

That should be no problem. You can try without any Autobahn involved …
sth like

var d = $.Deferred();

d.then(function (kw) { /* do your XMLHttpRequest thing */ });

d.resolve(“mykeyword”);

If I skip the XMLHttpRequest I can do anything I want in the

Javascript PubSub event handler. But if I make the request from inside

the handler and then watch the program flow via Chromiums Developer

Tools window it jumps into the autobahn.min.js code and then just exits

Why would issueing a XMLHttpRequest jump into Autobahn code?

cleanly out of that and the XMLHttpRequest is never answered. If I drop

the keyword into an array and poll it all works as expected.

Is your code online / can you post it?

0 Likes

#9

Why don’t you switch to the unminified autobahn.js and see precisely where it is hanging. That said my feeling is this not an autobahn.js problem and you are seeing a side effect of something else.

I’m using autobahn.js quite heavily and so far haven’t encountered any problems using either pub/sub or rpc.

···

On Thu, Aug 29, 2013 at 5:16 AM, Trendal Toews trenda...@gmail.com wrote:

This is the code that calls the Ajax function

string is the list of ID’s that gets passed from the websocket event to the XMLHttpRequest. The PHP script uses that to generate a set of data to return.

Ajax(“GET”, “core/GET_weightcert_data.php?weightcerts=” + string, true, this.lst);

On Wednesday, August 28, 2013 12:12:59 PM UTC-7, Trendal Toews wrote:

// This is the function that handles the event data
this.NewDataHandler = function (topic, data)

{

if (data["type"] == "Weightcert")
{       // data["type"] does equal "Weightcert".  That is confirmed

// data[“data”] is a list of database ID’s that get used to pull some data

// So that is where the XMLHttpRequest happens

// The function is called and the XMLHttpRequest is triggered but then the function exits and no data is ever sent back from the server

  D.Podium.Weightcert_Form.list_weightcerts(data["data"]);
}

if (data[“type”] == “Fill Order”)

{

// Handle new fill order…

}

}

The function that pulls the data is as follows:

this.Ajax = function (type, url, sync, func)
{
  var x = new XMLHttpRequest();
  x.open(type, url, sync);
  x.onreadystatechange = function()
  	{
  		if(x.readyState == 4 && x.status == 200)
  		{
  			func(x.responseText);
  		}
  	}
  x.send(null);
}

On Wednesday, August 28, 2013 11:59:11 AM UTC-7, Tobias Oberstein wrote:

Am 28.08.2013 20:51, schrieb Trendal Toews:

Yes that is correct. I am receiving a WAMP PubSub event. The even

handler, in this case checks the data for a keyword. If it exists the

event handler pulls some data from a database via a new XMLHttpRequest.

That should be no problem. You can try without any Autobahn involved …
sth like

var d = $.Deferred();

d.then(function (kw) { /* do your XMLHttpRequest thing */ });

d.resolve(“mykeyword”);

If I skip the XMLHttpRequest I can do anything I want in the

Javascript PubSub event handler. But if I make the request from inside

the handler and then watch the program flow via Chromiums Developer

Tools window it jumps into the autobahn.min.js code and then just exits

Why would issueing a XMLHttpRequest jump into Autobahn code?

cleanly out of that and the XMLHttpRequest is never answered. If I drop

the keyword into an array and poll it all works as expected.

Is your code online / can you post it?

You received this message because you are subscribed to the Google Groups “Autobahn” group.

To unsubscribe from this group and stop receiving emails from it, send an email to autobahnws+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.


Neville Franks, Author of Surfulater - Your off-line Digital Reference Library

Soft As It Gets Pty Ltd, http://www.surfulater.com - Download your copy now.

Victoria, Australia Blog: http://blog.surfulater.com

0 Likes

#10

Okay. I didn’t realize that. I will give it (unminified) a try tomorrow. But, I agree, as I noted in an earlier post, it most likely is some issue not related or at least primarily to autobahn.

I admit to being very weak on how to put together a proper websocket server in conjunction with a standard web application. I ran out of time this year before our busy season so I am just pinching things together and I will put effort into the “proper” way of doing things next year. At this point the only thing I have accomplished is adding more topics to the standard pubsub server and I do have one python client acting as a bridge between a standard GET request and websockets. The GET is coming from some hardware on a 485 network. But for the life of me I couldn’t figure out how to trip a python script to start, subscribe, publish and then shutdown. Wound up just waiting 1 second and killing it with the PID. So, as you can see I am quite ignorant. But I’m learning.

···

On Wednesday, August 28, 2013 9:37:02 PM UTC-7, Neville Franks wrote:

Why don’t you switch to the unminified autobahn.js and see precisely where it is hanging. That said my feeling is this not an autobahn.js problem and you are seeing a side effect of something else.

I’m using autobahn.js quite heavily and so far haven’t encountered any problems using either pub/sub or rpc.

On Thu, Aug 29, 2013 at 5:16 AM, Trendal Toews tren...@gmail.com wrote:

This is the code that calls the Ajax function

string is the list of ID’s that gets passed from the websocket event to the XMLHttpRequest. The PHP script uses that to generate a set of data to return.

On Wednesday, August 28, 2013 12:12:59 PM UTC-7, Trendal Toews wrote:

// This is the function that handles the event data
this.NewDataHandler = function (topic, data)

{

if (data["type"] == "Weightcert")
{       // data["type"] does equal "Weightcert".  That is confirmed

// data[“data”] is a list of database ID’s that get used to pull some data

// So that is where the XMLHttpRequest happens

// The function is called and the XMLHttpRequest is triggered but then the function exits and no data is ever sent back from the server

  D.Podium.Weightcert_Form.list_weightcerts(data["data"]);
}

if (data[“type”] == “Fill Order”)

{

// Handle new fill order…

}

}

The function that pulls the data is as follows:

this.Ajax = function (type, url, sync, func)
{
  var x = new XMLHttpRequest();
  x.open(type, url, sync);
  x.onreadystatechange = function()
  	{
  		if(x.readyState == 4 && x.status == 200)
  		{
  			func(x.responseText);
  		}
  	}
  x.send(null);
}

On Wednesday, August 28, 2013 11:59:11 AM UTC-7, Tobias Oberstein wrote:

Am 28.08.2013 20:51, schrieb Trendal Toews:

Yes that is correct. I am receiving a WAMP PubSub event. The even

handler, in this case checks the data for a keyword. If it exists the

event handler pulls some data from a database via a new XMLHttpRequest.

That should be no problem. You can try without any Autobahn involved …
sth like

var d = $.Deferred();

d.then(function (kw) { /* do your XMLHttpRequest thing */ });

d.resolve(“mykeyword”);

If I skip the XMLHttpRequest I can do anything I want in the

Javascript PubSub event handler. But if I make the request from inside

the handler and then watch the program flow via Chromiums Developer

Tools window it jumps into the autobahn.min.js code and then just exits

Why would issueing a XMLHttpRequest jump into Autobahn code?

cleanly out of that and the XMLHttpRequest is never answered. If I drop

the keyword into an array and poll it all works as expected.

Is your code online / can you post it?

Ajax(“GET”, “core/GET_weightcert_data.php?weightcerts=” + string, true, this.lst);

You received this message because you are subscribed to the Google Groups “Autobahn” group.

To unsubscribe from this group and stop receiving emails from it, send an email to autobahnws+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.


Neville Franks, Author of Surfulater - Your off-line Digital Reference Library

Soft As It Gets Pty Ltd, http://www.surfulater.com - Download your copy now.

Victoria, Australia Blog: http://blog.surfulater.com

0 Likes

#11

Trendal,

FWIW: forwarding HTTP/GET requests as WAMP PubSub events could all be done quite easily within 1 server process based on AutobahnPython.

I suggest you have a look at the various echo_** examples

https://github.com/tavendo/AutobahnPython/tree/master/examples/websocket

and read a little Twisted docs (such as reactor.stop())

Hope this helps,

/Tobias

···

Am 29.08.2013 06:50, schrieb Trendal Toews:

Okay. I didn't realize that. I will give it (unminified) a try
tomorrow. But, I agree, as I noted in an earlier post, it most likely
is some issue not related or at least primarily to autobahn.

I admit to being very weak on how to put together a proper websocket
server in conjunction with a standard web application. I ran out of
time this year before our busy season so I am just pinching things
together and I will put effort into the "proper" way of doing things
next year. At this point the only thing I have accomplished is adding
more topics to the standard pubsub server and I do have one python
client acting as a bridge between a standard GET request and websockets.
  The GET is coming from some hardware on a 485 network. But for the
life of me I couldn't figure out how to trip a python script to start,
subscribe, publish and then shutdown. Wound up just waiting 1 second
and killing it with the PID. So, as you can see I am quite ignorant.
  But I'm learning.

On Wednesday, August 28, 2013 9:37:02 PM UTC-7, Neville Franks wrote:

    Why don't you switch to the unminified autobahn.js and see precisely
    where it is hanging. That said my feeling is this not an autobahn.js
    problem and you are seeing a side effect of something else.

    I'm using autobahn.js quite heavily and so far haven't encountered
    any problems using either pub/sub or rpc.

    On Thu, Aug 29, 2013 at 5:16 AM, Trendal Toews <tren...@gmail.com > <javascript:>> wrote:

        This is the code that calls the Ajax function

        string is the list of ID's that gets passed from the websocket
        event to the XMLHttpRequest. The PHP script uses that to
        generate a set of data to return.

        Ajax("GET", "core/GET_weightcert_data.php?weightcerts=" +
        string, true, this.lst);

        On Wednesday, August 28, 2013 12:12:59 PM UTC-7, Trendal Toews > wrote:

            // This is the function that handles the event data
            this.NewDataHandler = function (topic, data)
            {
            if (data["type"] == "Weightcert")
            { // data["type"] does equal "Weightcert". That is
            confirmed

                             // data["data"] is a list of database ID's
            that get used to pull some data
                             // So that is where the XMLHttpRequest happens
                             // The function is called and the
            XMLHttpRequest is triggered but then the function exits and
            no data is ever sent back from the server
            D.Podium.Weightcert_Form.list___weightcerts(data["data"]);
            }
                     if (data["type"] == "Fill Order")
                     {
                            // Handle new fill order...
                     }
            }

            The function that pulls the data is as follows:

            this.Ajax = function (type, url, sync, func)
            {
            var x = new XMLHttpRequest();
            x.open(type, url, sync);
            x.onreadystatechange = function()
            {
            if(x.readyState == 4 && x.status == 200)
            {
            func(x.responseText);
            }
            x.send(null);
            }

            On Wednesday, August 28, 2013 11:59:11 AM UTC-7, Tobias > Oberstein wrote:

                Am 28.08.2013 20:51, schrieb Trendal Toews:
                 > Yes that is correct. I am receiving a WAMP PubSub
                event. The even
                 > handler, in this case checks the data for a keyword.
                  If it exists the
                 > event handler pulls some data from a database via a
                new XMLHttpRequest.

                That should be no problem. You can try without any
                Autobahn involved ..
                sth like

                var d = $.Deferred();
                d.then(function (kw) { /* do your XMLHttpRequest thing
                */ });
                d.resolve("mykeyword");

                 > If I skip the XMLHttpRequest I can do anything I
                want in the
                 > Javascript PubSub event handler. But if I make the
                request from inside
                 > the handler and then watch the program flow via
                Chromiums Developer
                 > Tools window it jumps into the autobahn.min.js code
                and then just exits

                Why would issueing a XMLHttpRequest jump into Autobahn
                code?

                 > cleanly out of that and the XMLHttpRequest is never
                answered. If I drop
                 > the keyword into an array and poll it all works as
                expected.

                Is your code online / can you post it?

        --
        You received this message because you are subscribed to the
        Google Groups "Autobahn" group.
        To unsubscribe from this group and stop receiving emails from
        it, send an email to autobah...@googlegroups.com <javascript:>.
        For more options, visit https://groups.google.com/groups/opt_out
        <https://groups.google.com/groups/opt_out>.

    --
    Neville Franks, Author of Surfulater - Your off-line Digital
    Reference Library
      Soft As It Gets Pty Ltd, http://www.surfulater.com - Download your
    copy now.
      Victoria, Australia Blog: http://blog.surfulater.com

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Likes

#12

Thank you very much for your help. I will look into those examples, I knew what I was doing wasn’t right but finally when the timer goes ding you have to get something done and move on. And I’ll read the Twisted docs. But I am seriously out of time this year so it will be in about 2 months after harvest is over. I am bookmarking this thread for later use. I will come back and do it right then and I’m sure I will come against more things I need help with. I usually have time to dabble a little with the program as were using it so I may be able to clean up some of the mess as we go along.

···

On Thursday, August 29, 2013 6:18:42 AM UTC-7, Tobias Oberstein wrote:

Trendal,

FWIW: forwarding HTTP/GET requests as WAMP PubSub events could all be
done quite easily within 1 server process based on AutobahnPython.

I suggest you have a look at the various echo_** examples

https://github.com/tavendo/AutobahnPython/tree/master/examples/websocket

and read a little Twisted docs (such as reactor.stop())

Hope this helps,

/Tobias

Am 29.08.2013 06:50, schrieb Trendal Toews:

Okay. I didn’t realize that. I will give it (unminified) a try

tomorrow. But, I agree, as I noted in an earlier post, it most likely

is some issue not related or at least primarily to autobahn.

I admit to being very weak on how to put together a proper websocket

server in conjunction with a standard web application. I ran out of

time this year before our busy season so I am just pinching things

together and I will put effort into the “proper” way of doing things

next year. At this point the only thing I have accomplished is adding

more topics to the standard pubsub server and I do have one python

client acting as a bridge between a standard GET request and websockets.

The GET is coming from some hardware on a 485 network. But for the

life of me I couldn’t figure out how to trip a python script to start,

subscribe, publish and then shutdown. Wound up just waiting 1 second

and killing it with the PID. So, as you can see I am quite ignorant.

But I’m learning.

On Wednesday, August 28, 2013 9:37:02 PM UTC-7, Neville Franks wrote:

Why don't you switch to the unminified autobahn.js and see precisely
where it is hanging. That said my feeling is this not an autobahn.js
problem and you are seeing a side effect of something else.
I'm using autobahn.js quite heavily and so far haven't encountered
any problems using either pub/sub or rpc.
On Thu, Aug 29, 2013 at 5:16 AM, Trendal Toews <tren...@gmail.com >  > >     <javascript:>> wrote:
    This is the code that calls the Ajax function
    string is the list of ID's that gets passed from the websocket
    event to the XMLHttpRequest.  The PHP script uses that to
    generate a set of data to return.
    Ajax("GET", "core/GET_weightcert_data.php?weightcerts=" +
    string, true, this.lst);
    On Wednesday, August 28, 2013 12:12:59 PM UTC-7, Trendal Toews >  > >         wrote:
        // This is the function that handles the event data
        this.NewDataHandler = function (topic, data)
        {
        if (data["type"] == "Weightcert")
        {       // data["type"] does equal "Weightcert".  That is
        confirmed
                         // data["data"] is a list of database ID's
        that get used to pull some data
                         //  So that is where the XMLHttpRequest happens
                         // The function is called and the
        XMLHttpRequest is triggered but then the function exits and
        no data is ever sent back from the server
        D.Podium.Weightcert_Form.list___weightcerts(data["data"]);
        }
                 if (data["type"] == "Fill Order")
                 {
                        // Handle new fill order...
                 }
        }
        The function that pulls the data is as follows:
        this.Ajax = function (type, url, sync, func)
        {
        var x = new XMLHttpRequest();
        x.open(type, url, sync);
        x.onreadystatechange = function()
        {
        if(x.readyState == 4 && x.status == 200)
        {
        func(x.responseText);
        }
        }
        x.send(null);
        }
        On Wednesday, August 28, 2013 11:59:11 AM UTC-7, Tobias >  > >             Oberstein wrote:
            Am 28.08.2013 20:51, schrieb Trendal Toews:
             > Yes that is correct.  I am receiving a WAMP PubSub
            event.  The even
             > handler, in this case checks the data for a keyword.
              If it exists the
             > event handler pulls some data from a database via a
            new XMLHttpRequest.
            That should be no problem. You can try without any
            Autobahn involved ..
            sth like
            var d = $.Deferred();
            d.then(function (kw) { /* do your XMLHttpRequest thing
            */ });
            d.resolve("mykeyword");
             >   If I skip the XMLHttpRequest I can do anything I
            want in the
             > Javascript PubSub event handler.  But if I make the
            request from inside
             > the handler and then watch the program flow via
            Chromiums Developer
             > Tools window it jumps into the autobahn.min.js code
            and then just exits
            Why would issueing a XMLHttpRequest jump into Autobahn
            code?
             > cleanly out of that and the XMLHttpRequest is never
            answered.  If I drop
             > the keyword into an array and poll it all works as
            expected.
            Is your code online / can you post it?
    --
    You received this message because you are subscribed to the
    Google Groups "Autobahn" group.
    To unsubscribe from this group and stop receiving emails from
    it, send an email to autobahnws+...@googlegroups.com <javascript:>.
    For more options, visit [https://groups.google.com/groups/opt_out](https://groups.google.com/groups/opt_out)
    <[https://groups.google.com/groups/opt_out](https://groups.google.com/groups/opt_out)>.
--
Neville Franks, Author of Surfulater - Your off-line Digital
Reference Library
  Soft As It Gets Pty Ltd, [http://www.surfulater.com](http://www.surfulater.com) - Download your
copy now.
  Victoria, Australia    Blog: [http://blog.surfulater.com](http://blog.surfulater.com)

You received this message because you are subscribed to the Google

Groups “Autobahn” group.

To unsubscribe from this group and stop receiving emails from it, send

an email to autobahnws+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

0 Likes