xmlhttprequest

Case for having xmlhttprequest available in sync

非 Y 不嫁゛ 提交于 2020-01-04 04:02:05
问题 One could simply encapsulate number of synchronous requests as an asynchronous request. The "func" parameter within the below code could for example contain multiple synchronous requests in order. This should give you more power over data contrasting the use of the DOM as a medium to act on the data. (Is there another way?, it has been a while since I used javaScript) function asyncModule(func) { "use strict"; var t, args; t = func.timeout === undefined ? 1 : func.timeout; args = Array

Case for having xmlhttprequest available in sync

邮差的信 提交于 2020-01-04 04:02:01
问题 One could simply encapsulate number of synchronous requests as an asynchronous request. The "func" parameter within the below code could for example contain multiple synchronous requests in order. This should give you more power over data contrasting the use of the DOM as a medium to act on the data. (Is there another way?, it has been a while since I used javaScript) function asyncModule(func) { "use strict"; var t, args; t = func.timeout === undefined ? 1 : func.timeout; args = Array

Using scrapy to extract XHR request?

淺唱寂寞╮ 提交于 2020-01-04 02:38:13
问题 I'm trying to scrape social like counts that are being generated with javascript. I am able to scrape the desired data if I absolutely reference the XHR url. But the site I am trying to scrape dynamically generates these XMLHttpRequests with query string parameters that I do not know how to extract. For example, you can see that using the m, p, i, and g parameters unique to each page are used to construct the request url. Here is the assembled url: http://aeon.co/magazine/social/social.php

Can you detect a 301 redirect with Microsoft.XMLHTTP object?

我与影子孤独终老i 提交于 2020-01-04 02:18:28
问题 I'm using VBScript and the Microsoft.XMLHTTP object to scrape some web data. I have a list of URLs to check, but unfortunately some of them 301 redirect to others on the list, so I wind up with redundant data. Is it at all possible to make the XMLHTTP object fail on 301 redirect? Or at least cache the original response header? Or otherwise just let me know what happened? (notes: I have no control over the server I'm requesting data from; when I get new data, I could check if it's redundant,

XHR request hangs in safari on el capitan

放肆的年华 提交于 2020-01-04 01:58:06
问题 I have a wierd situation that we cannot figure out or make sense of. We have a web application. If i use chrome on osx it works. If i use safari and hit our QA environment it works. If i run safari on Mavericks against my local dev machine it works. If i run safari on el capitan against my local dev machine to does NOT work. What we see is that the browser is able to directly download assets but xhr requests sit there and spin indefinitely. One of the examples is were using angular with

prevent xhr from redirecting when response is 303 with location header

大兔子大兔子 提交于 2020-01-04 01:19:12
问题 I get a 303 response with a location header, how can I prevent XMLHttpRequest from redirecting? Below is the code var xhr = new XMLHttpRequest(); xhr.open('GET', '/api/v1/test' + $(e.target).data('machineimage')); xhr.onreadystatechange = function () { if (xhr.readyState == 4) { // here I need to get the `location` header and do something with it // xhr.getResponseHeader('location') // but before it reaches here, there is a redirect } }; xhr.send(); I observed its the same with jquery as well

Is there a way to see the final URL retrieved by an XMLHttpRequest?

寵の児 提交于 2020-01-03 19:35:31
问题 I'm doing an AJAX download that is being redirected. I'd like to know the final target URL the request was redirected to. I'm using jQuery, but also have access to the underlying XMLHttpRequest. Does anyone know a way to get the final URL? It seems like I'll need to have the final target insert its URL into a known location in the headers or response body, then have the script look for it there. I was hoping to have something that would work regardless of the target though. Additional note: I

Is there a way to see the final URL retrieved by an XMLHttpRequest?

房东的猫 提交于 2020-01-03 19:35:23
问题 I'm doing an AJAX download that is being redirected. I'd like to know the final target URL the request was redirected to. I'm using jQuery, but also have access to the underlying XMLHttpRequest. Does anyone know a way to get the final URL? It seems like I'll need to have the final target insert its URL into a known location in the headers or response body, then have the script look for it there. I was hoping to have something that would work regardless of the target though. Additional note: I

XHR Breakpoints in Firefox developer tools

末鹿安然 提交于 2020-01-03 09:05:15
问题 Does anybody know how to break on a XHR request on Firefox developer tools? Earlier in firebug I added breakpoints under Net panel. As the firebug is discontinued any workaround for Firefox developer tools is appreciated. 回答1: That's currently (Firefox 57.0) not possible. It's requested in bug 821610. Also other Break on… features like breaking on DOM mutations and breaking on cookie changes are still missing. Those features are given high priority for implementation regarding missing Firebug

AngularJS Access denied when loading partial in IE11

谁说胖子不能爱 提交于 2020-01-03 06:42:13
问题 Background I am attempting to develop an AngularJS app that is to be hosted as 'offline html' as part of the Resco MobileCRM software. This software provides offline access to CRM data via its own javascript libraries and this is working fine. I am also able to get a very simple angularjs application working, in terms of retrieving and displaying the data. The AngularJS application is uploaded to the CRM using the Resco interface and then is download to each client machine via the resco