Tracking http requests sent by the browser using javascript/jquery -
using javascript or jquery, there way track http requests(including headers, parameters, etc.), sent webpage? want achieve similar functionality of 'network' tab of google chrome's developer console. solutions found either tracking ajax requests or requests made using javascript(using xmlhttprequest object). functionality should cross browser compatible.
you have 3 choices.
make sure know places request can fired, , attach event it,
requestfired
. , bindonrequestfired
event in javascript / jquery code.go through network developers document or each browser , based on browser, execute it. feature may not available in older browsers internet explorer 7 , 8.
if particular server, read server log using server side script , access using endpoint. can use long polling method , fetch contents of log, may way:
// jquery $(document).ready(function () { setinterval (function () { $("#log").load("/path/to/endpoint.log"); }, 5000); });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <h3>logs</h3> <div id="log"></div>
Comments
Post a Comment