Skip to main content
more meaningful title
Link
Mołot
  • 21.9k
  • 8
  • 59
  • 112

Is there an AJAX command I can use to, quite literally, do nothing debug PHP variables without breaking AJAX call?

Tweeted twitter.com/#!/StackDrupal/status/516930510560718848
Source Link
Mołot
  • 21.9k
  • 8
  • 59
  • 112

Is there an AJAX command I can use to, quite literally, do nothing?

I know the list of Ajax framework commands. Every one of them is doing something useful. But sometimes I want, for debug, include a piece of debug data in my AJAX response. I want it to be unobtrusive, so var_dump is out. I need to wrap my debug data in some kind of command. On the other hand, I will view it using JS console, so I don't want it to actually change anything on my page. And changing something hidden with CSS is not feasible - I'm not in charge of CSS here. So it leaves me with commands approach.

Which command could I use for this purpose?

I was thinking about ajax_command_append with selector that will never be found, but I don't want to introduce any additional errors in my JavaScript Console.

Debugging it with xdebug is not, currently, possible, and I would rather avoid spending time and resources on creating VM, when what I need is something I can do with simple var_dump on non-AJAX pages.