0

I want to get reponse data send by a Jetty Server via POST within a Greasemonkey script.

New data is send every few seconds.

How can I directly access the data, that is displayed in Firebug "Network" tab as response data? (I tried to get the data with solutions provided here that make use of jQuery and ajaxSuccess, but that did not work. And I am not sure if the POST data is returned from an jQuery ajax request. So is there a way to directly access the POST "stream").

djot
  • 2,952
  • 4
  • 19
  • 28

1 Answers1

3

The best way depends highly on details that you've not (yet) provided:

  1. Exactly how does the page send and receive the information. Is it really form posts, or is it AJAX? If AJAX, is jQuery involved? Pages can post without AJAX; are iframes involved?
    Link to the target page.

  2. What does the page do with the information? Does it update displays?

  3. What is your ultimate reason for wanting the information? Most of the time, it's easier not to try and intercept -- and parse -- AJAX. Usually, monitoring the DOM tree is much easier and more robust way of getting what you want.


If the page displays the data, you want, to the user, the best way to get it is shown in "How can I detect AJAX node insertion...".


If you really want to intercept the data:

Community
  • 1
  • 1
Brock Adams
  • 90,639
  • 22
  • 233
  • 295
  • As I asked for: It's not a form submission (post), the data is not added to the DOM and jQuery is there but I think not used for AJAX requests. I did already find the links you provided and a lot more. Currently I am struggeling on how to get anything run at the right moment to be even able to catch some data. – djot Jul 22 '12 at 10:08
  • ... - my tries to bind events all fail because (the right) document is not ready/available when I bind them. – djot Jul 22 '12 at 10:15
  • We can't help you any more without details. Link to the target page and/or show **exactly** what it is doing. ... If you examine the 3rd and 4th links I provided, you'll see that no event binding is necessary. Those techniques actually overwrite `XMLHttpRequest` function(s) -- which you can do at any time, the document does not have to be available. – Brock Adams Jul 22 '12 at 10:20