trigger event before content is parsed after ajax I want to ajaxify my site. Everything, that is usally parsed as "Page Content" sould be opened in a lightbox. 
So the idea is to ajaxify every link and let #lightbox be filled with the result.

but before ajax parses the request-result, I want some javascript to be done. So I want an event to be triggered after the ajax respond, and want to parse the result by myself.

any suggestions?

EDIT:

I could store the content in an hidden div#object, and use an ajax_command_invoke('body','trigger',array('myevent'))  to trigger a function attached to myevent. Does this make sense?
than I just dont know how to implement this to all links.
Are you using AJAX API? All the Ajax commands have the same return, for example

array(
    'command' =&gt; 'insert',
    'method' =&gt; 'html',
    'selector' =&gt; $selector,
    'data' =&gt; $html,
    'settings' =&gt; $settings,
);


And if you open the file misc/ajax.js, you will find insert() function in Drupal.ajax.prototype.commands. I think now you got the idea right? You just need to define a new ajax command by extending standard library, for example 

Drupal.ajax.prototype.commands.lightbox = function (ajax, response, status) {
    // Do something with response.
};


And on server side, you just need to return 

array(
    'command' =&gt; 'lightbox',
);


You can put more options in the command like what core does.