During the page load there are number of HTTP requests for document itself and it开发者_如何学Gos requisites. How do i hook them, retrieve target URL and prevent request from being sent if certain condition met? Plug-ins can also issue HTTP requests, i would like to cover them too.
There are several ways to issue a redirect:
* Server-side: You configure your web server to issue a 300 HTTP response code (most commonly 301 ("moved permanently") or 302 ("found"/"moved temporarily")), with a Location header set to the new URL.
* Client-side: You include the http-equiv="refresh" attribute in the meta tag or set the JavaScript window.location object (with or without the replace() method) in the head of the HTML document.
精彩评论