1 (edited by Charset 2011-04-13 5:16:02 PM)

Topic: get name of request function


i'm displayeing a loding image globally on my site but would like to explude some functions from displaying it.

Is there a way to get the name of the request function which was called, so i would be able to exclude the loading image to display if a certain request function had been called?

something like this (capitalized part is the missing part):

xajax.callback.global.onRequest = function() { IF( REQUEST_FUNCTION_NAME != 'XY' ) { xajax.$('loading').style.display = 'block';}  }

Re: get name of request function

hey again,

it's sad that the xajax community seems to be dead. I really like xajax and my whole framework builds up on it, but there doesn't seem to be any life in the project anymore hmm

I now found a solution to my problem myself and i would like to share it with everyone. For me it was really difficult to find it, but it would have been easy for one of the pros to answer if there had been anyone active anymore.

So the answer to the problem is the folloewing code:

xajax.callback.global.onRequest = function(oRequest) { if( oRequest.functionName.xjxfun != 'session_refresh' ){ xajax.$('loading').style.display = 'block'; } }
xajax.callback.global.beforeResponseProcessing = function(oRequest) { if( oRequest.functionName.xjxfun != 'session_refresh' ){ xajax.$('loading').style.display='none'; } }

As you can see the name of the request function is saved within oRequest.functionName.xjxfun. But i also had to figure out, that you have to pass oRequest to the function. For someoe who knows javascript better it probably would have been obvious.


Re: get name of request function


Sorry you think the community is dead. sad  Seems to be quite a few posts each week so xajax is definitly not dead.

I did look into the xajax js when you originally posted the problem and did not find the answer. But then I got distracted and forgot to let you know. Sorry.

I appreciate your solution as will anyone else having the problem.

I haven't heard the 0.6 status lately but, being a volunteer project, I am certain that some time is being spent on it.


If you ever stop learning you may as well dig a hole, crawl in and pull the top over yourself.

Re: get name of request function

Hey Edrobinson,

thanks for your reply. It's good to know, that there are people still supporting xajax. I'm glad my impression that no one is interestead in xajax anymore might not be correct.

keep on working on it, please. It's really a great piece of software!


5 (edited by robin33 2012-07-26 7:45:44 AM)

Re: get name of request function

I need and wants displaying globally image in my site. thanks a lot...!!!!

stepahead zone

Re: get name of request function

Hi robin33 and welcome to xajax. You should checkout Charset's posts in this thread. If you care to be more specific on what you are trying to achieve, maybe i could help.